Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mapping for json payload keys #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ms49434
Copy link

@ms49434 ms49434 commented Apr 28, 2024

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

This mod will simplify the integration of this driver into an existing setup.
@mr-manuel
Copy link
Owner

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

@peterix99
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants