venus-os_dbus-mqtt-grid icon indicating copy to clipboard operation
venus-os_dbus-mqtt-grid copied to clipboard

Add mapping for json payload keys

Open ms49434 opened this issue 1 year ago • 2 comments
trafficstars

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

ms49434 avatar Apr 28 '24 10:04 ms49434

Thanks for contributing. I like the idea, but I would make it more flexible and repeat less same code.

  1. Like loop through all values set under [MAP], if there are any.
  2. Allow nested values like energy_forward = grid/total/out

mr-manuel avatar May 02 '24 16:05 mr-manuel

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.

peterix99 avatar May 06 '24 22:05 peterix99