Variable Reports null in Some Cases - Need Help Diagnosing Issue

Hi everyone,

I'm encountering an issue where the variable PT_RETE sometimes shows a null value, while at other times it is correctly updated with numeric values. I've attached some screenshots of my setup, including:

  1. The trigger events and conditional actions in Rule Machine.
  2. The logs showing the variable updates (both null and numeric values).
  3. The list of variables configured in my system.

Here’s a summary of the situation:

  • The rule is triggered when the variable PT_RETE changes.
  • Conditional actions are set to turn on/off a device based on specific thresholds for PT_RETE.
  • In the logs, I see updates where PT_RETE is correctly assigned numeric values (e.g., -1310.0), but there are also instances where it shows null.
  • The variable is set up as a global variable.

I’m not sure what could be causing this behavior. Could it be related to the initialization of the variable, an issue with my rule configuration, or something else?

Any advice or insights into why this might be happening would be greatly appreciated! Let me know if additional details are needed.

Thank you in advance!

image
image
image

What is dev:116?

Specifically, what is assigning the value to the PT_RETE hub variable? - I'm assuming that's some device? - What is the driver? - And can you turn on debug logging for that device, so you can see a bit more detail on what the device is doing when this value is assigned...

1 Like

Hi thanks for the answer
dev:116 is the connector variable himself


is written by a MAKER API

[
{
"name": "PT_RETE",
"label": "PT_RETE",
"type": "Connector Variable",
"id": "116",
"date": "2024-11-27T16:57:47+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"Actuator",
"Variable",
"Sensor"
],
"attributes": {
"variable": "320.0",
"dataType": "STRING",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setVariable"
}
]
},
{
"name": "H_CASA",
"label": "H_CASA",
"type": "Connector Humidity Sensor",
"id": "124",
"date": "2024-11-27T16:57:47+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"RelativeHumidityMeasurement",
"Sensor"
],
"attributes": {
"humidity": "45.0",
"dataType": "NUMBER",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setHumidity"
}
]
},
{
"name": "PT_SOLE",
"label": "PT_SOLE",
"type": "Connector Variable",
"id": "117",
"date": "2024-11-27T16:57:47+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"Actuator",
"Variable",
"Sensor"
],
"attributes": {
"variable": "0.0",
"dataType": "STRING",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setVariable"
}
]
},
{
"name": "T_CASA",
"label": "T_CASA",
"type": "Connector Temperature Sensor",
"id": "125",
"date": "2024-11-27T16:57:47+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"TemperatureMeasurement",
"Sensor"
],
"attributes": {
"temperature": "19.2",
"dataType": "NUMBER",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setTemperature"
}
]
}
]

can somebody help me?

I used a temperature connector, it works, but it is a little weird.
Is it possible to create a decimal connector?

How do i do it?

I have a small python script/executable that communicates with the heating system and solar panels.
Panels and heating send data to a control box to coordinate.
From that control unit I take with python the data I am interested in, many to populate a database that I visualize with graphana, others for automation such as PT_RETE and PT_SOLE which just the power consumed by the house and the power produced by the solar panels.
These are then sent to Hubitat with the MAKER API protocol.
This is where my Variables story begins :slight_smile:

1 Like

I will try all the solutions
Simplifying is always best
Thank you all

The power meter on MAKER API protocol does not have a set command like Variables or Temperatures.

[
{
"name": "Generic Component Power Meter",
"label": "POT_RETE",
"type": "Generic Component Power Meter",
"id": "136",
"date": null,
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"Refresh",
"PowerMeter",
"Sensor"
],
"attributes": {
"power": null,
"dataType": "NUMBER",
"values": null
},
"commands": [ :warning: :warning: :warning: :warning: :warning:
{
"command": "refresh" :arrow_left: :arrow_left: :arrow_left:
}
]
},
{
"name": "PT_RETE",
"label": "PT_RETE",
"type": "Connector Temperature Sensor",
"id": "116",
"date": "2025-01-06T19:10:27+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"TemperatureMeasurement",
"Sensor"
],
"attributes": {
"temperature": "880.0",
"dataType": "NUMBER",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setTemperature" :arrow_left: :arrow_left: :arrow_left:
}
]
},
{
"name": "H_CASA",
"label": "H_CASA",
"type": "Connector Humidity Sensor",
"id": "124",
"date": "2025-01-06T19:10:27+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"RelativeHumidityMeasurement",
"Sensor"
],
"attributes": {
"humidity": "45.0",
"dataType": "NUMBER",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setHumidity" :arrow_left: :arrow_left: :arrow_left:
}
]
},
{
"name": "PT_SOLE",
"label": "PT_SOLE",
"type": "Connector Variable",
"id": "117",
"date": "2025-01-06T19:10:27+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"Actuator",
"Variable",
"Sensor"
],
"attributes": {
"variable": "0.0",
"dataType": "STRING",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setVariable" :arrow_left: :arrow_left: :arrow_left:
}
]
},
{
"name": "T_CASA",
"label": "T_CASA",
"type": "Connector Temperature Sensor",
"id": "125",
"date": "2025-01-06T19:10:27+0000",
"model": null,
"manufacturer": null,
"room": null,
"capabilities": [
"TemperatureMeasurement",
"Sensor"
],
"attributes": {
"temperature": "19.2",
"dataType": "NUMBER",
"values": null
},
"commands": [
{
"command": "parse"
},
{
"command": "setTemperature" :arrow_left: :arrow_left: :arrow_left:
}
]
}
]