Automation -> KNX Expose

I want to expose a value to the knx bus in an automation.
How can i do this?

Best regards,

Stefan

Use the knx.send service to send data to knx bus.

If you want to expose a state or attribute of an entity you can configure expose.

If you want to configure an expose in an automation (eg when writing a blueprint) you’ll have to wait for


(or maybe give it a review :wink:)
1 Like

Thanks for the quick reply. I’m not sure if that’s what it need.
I already added an exposure in the configuration.yaml but i want to force this exposure to send the value to the bus at a specific time/trigger.

The value is the current time and date. Can i do it with knx.send?

Current date and time works with knx.expose as mentioned above.

This how I have it in my configuration:

knx:
  expose:
    - type: “datetime”
      address: “0/0/1”
    - type: “time”
      address: “0/0/2”

Right. It will send once an hour.

If you need to send custom time (not localtime) you could try knx.send with raw byte values.

Thats what i’m doing. But i do have an KNX-Device that can request a time update.

Therefore i would like to add this as an automation.

Devices asks on 5/0/3 for time update --> triggers automation --> sends exposed current time.

If your device asks for an update with a GroupValueRead the expose: time / date / datetime will answer with current localtime.

The device triggers this on a different GA. I don’t know why :smiley:

Hello,

A small problem with datetime sent by HA. Here is my configuration

knx.yaml file
exposes:

  • type: ‘datetime’
    address: ‘8/6/2’

In GA 8/6/2, the object 505 (datetime) of the ABA / S 1.2.1 logic controller and a datetime object of the ABA are linked, which allows a connection to the functions implemented in the ABA.

With the group monitor, if I read the GA 8/6/2, I have the datetime return, but while letting the telegrams scroll in the monitor, I do not see a telegram passing with a DPT 19.001, although it should appear every minute?

No, it is sent once an hour. I think on init and then periodically, so not every full hour, but an hour after startup.

Thank you. I am going to test with Time which must send well every minute?

No it’s the same. Why should it send every minute - every hour is more than enough.

In my KNX installation I have an advanced logic controller (ABA / S1.2.1) with calendars and some 30-minute programs for example.

Time in KNX is used to initialize and sync internal clocks, not to provide a minute-signal. Especially when it is an “advanced” logic controller it is surely able to keep its own time for hours / days without drifting significant.
When such devices are restarted they usually send a GroupValueRead - which will be answered by a GroupValueResponse. This way you can also test your time exposure from ETS group monitor.

Thanks for the explanation. I left the group monitor running and HA does send “time” and “datetime” once per hour.
I made an error by imagining an operation other than that of synchronization but my problem remains intact: how to display in HA the value of the datetime when a KNX output goes to 0?

I’m not sure I understand your question right.
If you want to know when (current local time) a telegram (eg. with payload 0) to a specific group address was sent: I’d listen to knx_event and parse the events “time_fired” attribute.
(In the next version sensors and binary_sensors will also have a timestamp as extra_state_attribute).
If you want to parse the payload of a datetime telegram (DPT 10, 11, 19) - not the current local time - then this is not supported by the HA knx integration.

In the following GA, a read with the group monitor returns the local date and time.

I am looking for a way to display this information in HA when watering is finished (output knx = 0)