Time is exposing wrongly to KNX bus

Hi all,

when I expose “time” to KNX bus from HA in order to set it on KNX switch, only GMT time applies.
Time zone is set correctly in configuration.yaml
I have the following code to expose:

knx:
  expose:
    - type: 'time'
      address: '0/1/13'
      entity_id: 'sensor.time' # if I remove this line, GMT is also applied

I also set up time sensor:

sensor:
  - platform: time_date
    display_options:
      - 'time'

State for sensor.time is showing correctly in HA but it being exposed to bus as GMT time.

I also tried to call service:
Service: knx.send
Service Data: {“address”: “0/1/13”, “payload”: “11:00”}
but it seams time value should be populated differently.

Any ideas?

Follow the instructions at the top of the page & reformat your configuration. My wild guess is you are missing the closing quote for the time sensor.
Spacing may not be incorrect but I cannot tell because it was improperly entered here.

Thanks!
I have edited the initial post and closing quote should have been there.
Not sure this is formatting issue because both sensor: and expose: work fine except for the time value applied to the device.

I have the same problem. Did you find a solution?

No, I tried to expose different time zones but GMT is always set.

I know it is an old topic. but as far as i can see it isn’t resolved.

In the past i used a debian box with a manual installation of homeassistant. the time was displayed correctly.
but since most custom components are not working i changed to the Docker (on vmware) version.
since i copied and paste the configuration i know the configuration was working fine.

the only problem now is that the system is displaying UTC time instead of local time.

the interesting parts of the config.

homeassistant:
.....
  time_zone: Europe/Amsterdam
knx:
  tunneling:
    host: '..........'
    port: 3671
    local_ip: '0.0.0.0'
  expose:
    - type: 'time'
      address: '31/1/2'
    - type: 'datetime'
      address: '31/1/1'

Have you set the timezone for the docker container?
The Knx integration sends the local system time - it doesn’t get the time value from HA.

In the KNX page it’s said that entity_id is not needed for types time, date and datetime. If so we can only expose specific time and I’m not quite sure which one whether it’s system time or the one set in HA or even GMT only.

I would prefer to have entity_id available in order to know exactly what value is sent to the bus and to have possibility to sent custom time.

By the way, a year ago when I faced the issue, the config check didn’t return any error when I added entity_id into expose.

I can’t check it now but it would be good to know if the custom time sensor will work with config like this:

input_datetime:
  custom_time:
    name: My Custom Time
    has_date: false
    has_time: true

knx:
  expose:
    - type: 'time'
      entity_id: 'custom_time'
      address: '1/2/3'

No. Entity_id is not evaluated for time values. The current time returned by pythons time.localtime() is sent to the bus. I guess that’s system time.

I’m having this issue since upgrading to v0.118 (i think).
Knx is receiving the UTC time, while HA is configured for using UTC+1

Is this a issue in the 0.118 relesae or do we have to change some configs ? Didn’t find any documentation for this.

Same issue here. When I tried to access the host system, I found that /etc/localtime points to UTC. I wish I could change that but I have only read-only access.

Downgrading to v0.117.6 seems to have resolved the issue for me.

Same issue for me. I think this is a bug introduced in v0.118.0 and should be fixed.