KNX write value payload invalid

Hey!
I’m testing the connection to KNX.
Reading values is working fine, but I’m struggling trying to write values.
This is an example:

knx:
  expose:
    - type: '1byte_unsigned'
      address: '0/0/5'
      entity_id: 'sensor.hencozona1_forzamodo'

sensor:
  - platform: knx
    name: HencoZona1.ForzaModo
    state_address: '0/0/5'
    type: '1byte_unsigned'

When I try to set the state from the dev tool, I’m getting this error on the log

2020-03-26 21:09:02 ERROR (MainThread) [xknx.log] Error while processing telegram <CouldNotParseTelegram description="payload invalid" device_name="HencoZona1.ForzaModo" group_address="0/0/5" payload="<DPTBinary value="0" />"/>

Can you help me? What am I doing wrong?
Thanks
R

It seems you are using the service knx.send. This would require a raw Knx payload as iterable - don’t use it.

Configure a template sensor or an input_number and expose its entity_id.

Thanks!

Using a template is working!

knx:
  expose:
    - type: '1byte_unsigned'
      address: '0/0/5'
      entity_id: 'sensor.zone1_modo'

sensor:
  - platform: template
    sensors:
      zone1_modo:
        friendly_name: "Zone1 ForzaModo templ"
        entity_id: sensor.hencozona1_forzamodo_knx
        value_template: "{{ states('sensor.HencoZona1_forzamodo_knx') }}"
  - platform: knx
    name: HencoZona1.ForzaModo_KNX
    state_address: '0/0/5'
    type: '1byte_unsigned'

Now I want to try with an input value. I’m not sure on how to implement the UI.
Basically I can select between four different values ( 0,1,3,4). They mean 0=Auto, 1=Comf, 3=Econ, 4=Off. Any suggestions?

Maybe the KNX Climate component is anyway doing what you are looking for? https://www.home-assistant.io/integrations/climate.knx/

As moe said, have a look at the climate device. Or try to build something upon https://www.home-assistant.io/integrations/input_select/ - if this works out, please let me know - I’m also interested in this.

I’ve had a quick look at the climate.knx. It looks promising but I will have to modify it because the logic is a little bit different and the states are different.

I’ve worked on the input_select for the read automation. But it look that is not reading the correct state.

# Define input_select
input_select:
  zone_mode:
    name: Zone mode
    options:
      - "auto"
      - "comfort"
      - "economy"
      - "off"
    icon: mdi:target

- alias: Set Zone Mode Selector
  trigger:
    platform: state
    entity_id: sensor.hencozona1_forzamodo_knx
  action:
     service: input_select.select_option
     data_template:
      entity_id: input_select.zone_mode
      option: >
            {% if is_state('sensor.hencozona1_forzamodo_knx', '4') %}
              off
            {% elif is_state('sensor.hencozona1_forzamodo_knx', '3') %}
              economy
            {% elif is_state('sensor.hencozona1_forzamodo_knx', 1 ) %}
              comfort
            {% else %}
              auto
            {% endif %}