venus-os_dbus-mqtt-grid
venus-os_dbus-mqtt-grid copied to clipboard
Add mapping for json payload keys
This mod will simplify the integration of this driver into an existing setup.
I already have a working setup with a Hichi IR Reader, OpenDTU, Zero Export, Node-Red, Mosquitto and a Cerbo GX. To add the Hichi (Tasmota) to Venus OS. Renaming the keys and the topic wasn't an option because of the existing setup.
A new (optional) section [MAP] in config.ini file allows you to map the keys used in your environment (i.e. power => Power_curr) and publish them to dbus using the dbus key names.
Example: ... [MAP] power = Power_curr (Read the key Power_curr for the power value) energy_forward = Total_in energy_reverse = Total_out
List of available keys: grid power voltage current frequency L1 L2 L3 power_L1 power_L2 power_L3 energy_forward energy_reverse
Thanks for contributing. I like the idea, but I would make it more flexible and repeat less same code.
- Like loop through all values set under [MAP], if there are any.
- Allow nested values like
energy_forward = grid/total/out
Great code! With more keys will be possible to connect a device to Venus OS using Ble, now I have a device (smartshunt) to RasPi running signalk connected by Ble and then to Pizero running Venus OS using your code and mqtt.