Skip to content

Development Testing Tips And Tricks

Daniel McInnes edited this page Nov 17, 2023 · 23 revisions

Connecting to VRM Broker

If you wish to connect to the VRM broker using the WebAssembly build, you need to follow these steps:

  1. Login to https://vrm.victronenergy.com/ in your web browser
  2. Click on the installation you wish to connect to, then click on Device List in the left-hand side, then click the Gateway device
  3. Copy the value shown for "VRM portal ID" and save it in notepad
  4. Construct a percent-encoded VRM username by prefixing your login email address with "vrmlogin_live_" and replacing the @ symbol with %40 e.g. if your email address is [email protected] then the VRM username will be vrmlogin_live_somebody%40example.com
  5. Open the "developer tools / console" in the browser, and run the following: console.log(localStorage["vrm.prod.storage.token"]). Copy down the result value (but without the speech quotes) - it should be a very long authentication token string, a VRM token
  6. Open notepad and construct a query string which looks like: ?id=vrm_portal_id&user=vrm_username&pass=vrm_token where the vrm_portal_id was ascertained in step 3, the vrm_username was ascertained in step 4, and the vrm_token was ascertained in step 5.
  7. Run the gui-v2 webassembly application in your browser (e.g. served by emrun or other webserver) and then paste in the query string you have constructed at the end, for example: http://localhost:30000/venus-gui-v2.html?id=abcdef123456&user=vrmlogin_live_somebody%40example.com&pass=longtokenstring. Press enter to reload the application with those parameters.

Note that in future, there will be a button you can click in the VRM website which will launch the application automatically with the required information passed securely to it, and the above process will no longer be required.

Device demo modes

To test some temperature sensors and relay settings: Run /opt/victronenergy/dbus-recorder/startdemo.sh 2 to add a 'Fridge' temperature sensor relay to the relay settings.

How to add a dbus data point

see: https://github.com/victronenergy/localsettings dbus -y com.victronenergy.settings /Settings/Services/MqttVrm SetValue 0

dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "CGwacs/DeviceIds", "default": "1,2,3,4,5,6"}]'

	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "CGwacs/DeviceIds", "default": "1,2,3,4,5,6"}]'

	custom name:
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1/CustomName", "default": "customname1"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/CustomName", "default": "customname2"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_3/CustomName", "default": "customname3"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_4/CustomName", "default": "customname4"}]'

	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1/ServiceType", "default": "pvinverter"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/ServiceType", "default": "grid"}]'

	classAndVrmInstanceItem:
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1/ClassAndVrmInstance", "default": "pvinverter:1"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/ClassAndVrmInstance", "default": "grid:1"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_3/ClassAndVrmInstance", "default": "genset:1"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_4/ClassAndVrmInstance", "default": "acload:1"}]'

	multiPhaseSupport:
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1/SupportMultiphase", "default": "0"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/SupportMultiphase", "default": "1"}]'

	isMultiphase:
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1/IsMultiphase", "default": "1"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/IsMultiphase", "default": "0"}]'


	pvOnL2:
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1_S/Enabled", "default": "0"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2_S/Enabled", "default": "0"}]'

	PV inverter on phase 2 Position:
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/Position", "default": "0"}]'



	/L2/ServiceType
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_1/L2/ServiceType", "default": "pvinverter"}]'
	dbus -y com.victronenergy.settings /Settings AddSettings '%[{"path": "Devices/cgwacs_2/L2/ServiceType", "default": "grid"}]'

Searching for duplicate translation strings

find . -name "*.qml" -exec grep "//%" {} \; | sed -Ez 's/[ ]( )+([/])//g' | sed -e 's/^[ \t]*//' | sort

Clone this wiki locally