Remote Commissioning ==================== In this scenario the customer is sent the HEMS in the post and then commissioning is completed remotely by a technician with customer cooperation. * HEMS is plugged in to power and router (possibly before phone call). * HEMS connectivity is verified by technician. * Technician SSH into HEMS Host OS via Balena Cloud. * Customer connects EV charger / relay controller either to HEMS wifi or home wifi. * Technician determines IP of EV charger / relay controller. * Technican uses curl to configure devices in consultation with customer (see details below for settings). * Technician verifies configuration of devices using HA. * Technician configures PowerShaper service HA integration. * Provides any other support / help. Determining IP/mDNS addresses of energy appliances -------------------------------------------------- If they are connected to the HEMS wifi then you can unambiguosly determine from the lease table in the Host OS (assuming they are still connected): .. code-block:: bash cat /var/lib/NetworkManager/dnsmasq-wlan0.leases Getting information about EV charger using curl ----------------------------------------------- This can be useful for testing basic connectivity and responsiveness and determining serial number where it cannot be looked up in lease table. .. code-block:: bash curl "http:///config" Getting information about Shelly using curl ------------------------------------------- This can be useful for testing basic connectivity and responsiveness, testing to see if settings have been correctly applied, seeing what version of firmware is/if there is firmware update waiting to be installed, and obtaining serial in case not connected to HEMS wifi. .. code-block:: bash curl "http:///status" Commissioning EV charger using curl ----------------------------------- The main step for commissioning the EV charger is configuring the MQTT connection. This can be done via curl in the following way: .. code-block:: bash curl "http:///savemqtt?enable=true&server=&topic=openevse-YYYY" Commissioning Shelly using curl ------------------------------- The Shelly can be connected to the HEMS MQTT server with the following commands: .. code-block:: bash curl http://10.42.0.xx/settings -G --data-urlencode "mqtt_server=10.42.0.1:1883" curl http://10.42.0.xx/settings -G --data-urlencode "mqtt_enable=true" (replacing xx with the correct value for the Shelly's IP address) The Shelly schedule and auto_off parameters can be set through the API. You can do this by sending the following calls from the Host OS: .. code-block:: bash curl http://10.42.0.xx/settings/relay/0 -G --data-urlencode "schedule_rules=0100-0123456-on,0600-0123456-off" curl http://10.42.0.xx/settings/relay/0 -G --data-urlencode "schedule=true" curl http://10.42.0.xx/settings/relay/0 -G --data-urlencode "auto_off=21600" The current configuration can be retrieved with the call: .. code-block:: bash curl http://10.42.0.xx/settings/relay/0 -G" Changing hostname online ------------------------ Note that this should not normally be neccesarry as of October 2020 as the hostname should be set correctly in the image when the HEMS are created. As per https://www.balena.io/docs/reference/supervisor/supervisor-api/#patch-v1devicehost-config the HEMS hostname can be modified online by making a request to the Balena supervisor API by getting a terminal either on the host or a running container with privileges: .. code-block:: bash curl -X PATCH --header "Content-Type:application/json" --data '{"network": {"hostname": "ccoop-hems-XXXX"}}' "$BALENA_SUPERVISOR_ADDRESS/v1/device/host-config?apikey=$BALENA_SUPERVISOR_API_KEY" Modifying Home Assistant user/password -------------------------------------- Can be useful in sitations where user has forgotten username/password after (re)setting it themself etc. Insider the HA container the `hass` command is available. This allows you to run a set of 'embedded' utility scripts (which are not documented but can be found here: https://github.com/home-assistant/core/tree/dev/homeassistant/scripts ): .. code-block:: bash hass --script