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

How and where to define a certain value template for a certain sensor #457

Open
Connor0308 opened this issue Dec 22, 2024 · 1 comment
Open

Comments

@Connor0308
Copy link

Connor0308 commented Dec 22, 2024

Dear,

after having tweaked my configuration back and forth, it seems that I now have quite a good starting point for my project.
However, one thing that still worries me is a simple value template correction.

Using this configuration line

r;w,,OffsetOutsideTemp,,,,,2D00,,,D2C,,K,Offset outside temperature (used to determined DisplayedOutsideTemp)

I wanted to make the offset for the temperature sensor writable.
This is how the the sensor is appearing in the MQTT explorer.

{
  "unique_id":"ebusd_ctlv2_OffsetOutsideTemp_0",
  "name":"OffsetOutsideTemp ",
  "device":{
   "identifiers":"ebusd_ctlv2",
   "manufacturer":"ebusd.eu",
   "name":"ebusd ctlv2",
   "via_device":"ebusd",
   "sw_version":"23.2",
   "suggested_area":"Heizung"
  },
  "value_template":"{{value_json[\"0\"].value}}",
  "state_topic":"ebusd/ctlv2/OffsetOutsideTemp",
  "command_topic":"ebusd/ctlv2/OffsetOutsideTemp/set",
  "min":-2047.94,
  "max":2047.94,
  "step":0.06,
  "unit_of_measurement":"K",
  "device_class":"temperature"
 }

While I can generally live with the strange min and max values, the a step of 0.06 is not favorable.
How can I fix this permanently - and not updating it with every restart?

Thank you!
Regards

Connor

@Connor0308
Copy link
Author

For anyone getting here (including a future me) - a possible workaround is to send the configuration
to the topic followed by /config and to retain the message.

The above mentioned configuration would look like

{
  "unique_id":"ebusd_ctlv2_OffsetOutsideTemp_0",
  "name":"OffsetOutsideTemp ",
  "device":{
   "identifiers":"ebusd_ctlv2",
   "manufacturer":"ebusd.eu",
   "name":"ebusd ctlv2",
   "via_device":"ebusd",
   "sw_version":"23.2",
   "suggested_area":"Heizung"
  },
  "value_template":"{{value_json[\"0\"].value}}",
  "state_topic":"ebusd/ctlv2/OffsetOutsideTemp",
  "command_topic":"ebusd/ctlv2/OffsetOutsideTemp/set",
  "min":-20,
  "max":20,
  "step":0.5,
  "unit_of_measurement":"K",
  "device_class":"temperature"
 }

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

No branches or pull requests

1 participant