Replies: 3 comments 3 replies
-
Huh. We do not have many users on Domoticz - but many on Home Assistant using the 'homeassistant' payload - without any such issue as you describe. I am wondering whether the issue you see is some kind of misinterpretation in Domoticz? |
Beta Was this translation helpful? Give feedback.
-
One more question: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'm using MQTT with topic 'homeassistant' to feed data to Domoticz, and it works fine, except for hour prices.
This is the same for all hours up to hour 36 (hour 37 in the prices struct is not referred to).
I look into it and have noticed some differences in the JSON structs.
The "val_tpl" in topic homeassistant/sensor/Cheapest1hr looks like:
"{{ value_json.prices.cheapest1hr | is_defined }}"
compared to val_tpl in topic for homeassistant/sensor/ams-cf58_prices0:
"{{ value_json.prices['0'] | is_defined }}"
I noted the difference between the two val_tpl references:
value_json.prices.cheapest1hr and value_json.prices['0']
cheapest1hr is autodetected by Domoticz, prices['0'] is not.
From the Domoticz error log:
2024-11-20 16:00:00.185 Error: MQTT: Exception (GetValueFromTemplate): in Json::Value::operator: requires arrayValue! (Template: value_json.prices[0])
The prices struct look like:
{
"id": "58:CF:79:9B:4C:7C",
"prices": {
"0": 1.9741,
"1": 1.7019,
...
"36": null,
"37": null,
"min": 0.8459,
"max": 1.9741,
"cheapest1hr": "2024-11-22T22:00:00Z",
"cheapest3hr": "2024-11-22T01:00:00Z",
"cheapest6hr": "2024-11-21T23:00:00Z"
}
}
So to me it looks as the correct reference should be value.prices.0.
Beta Was this translation helpful? Give feedback.
All reactions