How to add a new event type?

Hi,

I think I need to add a new event type for my thermostat device (Horstmann HRT4-ZW)

It has only a HEAT setpoint and so I either need an event to fire for my Lua code when the temperature goes below the current HEAT setpoint
or I need an event to fire on a change in ambient temperature which I can then evaluate in my Lua code.

I have been trying to use the “Ambient above” and “Ambient below” events but they seem to be evaluated as repeats of previous events
because I have the levels for those events set at 0 and 30 respectively (I don’t want to have multiple hardcoded setpoints in multiple places)

07 11/11/11 20:20:52.333 Event::Evaluate 2 Amb Temp Above scene Heating skipping repeat <0x803>
07 11/11/11 20:20:52.333 Event::Evaluate 3 Amb Temp Below scene Heating skipping repeat <0x803>

Thanks,

Alex

I use these Horstmann devices as well and run into this problem. I use a scene that runs every 10min and checks a variety of sensors and other conditions to see if the boiler needs to be turned on. For example, I take temperature in a number of rooms, alarm panel status (if all are in bed you do not need to heat that much), and setpoint from thermostat. As well, you may want to use the manual override button at the boiler and if you do so you need to make sure that the automatic stuff does not interfere. That can all be packed in some lua code in a scene.

Thanks utz. Yes I ended up with a timed scene that runs on 4min intervals but it seems a bit of a hack to me :-/ I’d rather have it properly event driven if I can achieve that?

I understand what you’re saying about the manual override. Nothing is going to annoy the better half more than her turning the heating on and then my code turning it off again :wink:

yes its a hack and not efficient, agree. But as the box is mostly idle it can do as well a small script once in a while.

Yes, exactly. I figured out that the override is constantly used as she claims the house is cold and the heating does not come on. (but a number of sensors show its not cold …)

"yes its a hack and not efficient, agree. But as the box is mostly idle it can do as well a small script once in a while. "

True enough, but I have big plans and want to start coding within a sensible event driven paradigm before I start
bolting on the heating zoning, energy metering, camera monitoring, alarm system integration, logging, graphing etc ;p

Hi ajlennon,

You can add your own events by editing the D_HVAC_ZoneThermostat1.json file. The drawback is that you must re-upload this file after every firmware upgrade.

e.g.

"event_N": {
    "label": "Thermostat HEAT set point goes under",
    "serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat",
    "argumentList": {
        "argument_1": {
            "dataType": "i4",
            "name": "CurrentSetpoint",
            "comparisson": "<",
            "prefix": "temperature: ",
            "suffix": " degrees"
        }
    }
}

Thanks. This helps. Looking through the .json file it looks as though all of these events define a variable name to be compared to an absolute value?

I think I may need to compare the CurrentSetPoint value TemperatureSensor1 on to the CurrentTemperature value on TemperatureSetpoint1_Heat?

Is that something the json can handle?

Thanks, Alex

Linking to @utz’s prior topic.

Thanks oTi@. No solution there then I guess