How to get toggle instead of value(1)?

Hi, i managed to inegrate a Denkovi i/o module, but for the digital inputs i am getting only values 0 or 1…
I want to get toggle switches like the wall plug switch.
How can i achieve this ?
Thanks in advance
Suti

You can’t. Switches are control (output) devices. Inputs are sensors. You can read an input’s value but you can’t set that value.

Thank you for your response.
Is there a possibility to set the input state to “on” or “off” instaed of just 1 or 0 ?

Thx

Yes that should be possible. The issue is that you have defined sensors instead of binary sensors. Can you post your config for the two digital inputs?

#######################################
# Sensors
#######################################
# Digital inputs
  - platform: snmp
    name: "Digital Input 1"
    host: 192.168.1xxxxxxx
    port: 161
    community: public
    baseoid: 1.3.6.1.4.1.42505.8.2.1.1.7.0
    scan_interval: 3
  - platform: snmp
    name: "Digital Input 2"
    host: 192.168.1xxxxxx
    port: 161
    community: public
    baseoid: 1.3.6.1.4.1.42505.8.2.1.1.7.1

This is the configuration.yaml

# Include board specific configuration files
#######################################
# smartDEN IP-Maxi (SNMP)
#######################################
group: !include smartDEN_IP_Maxi.SNMP/groups.yaml
sensor: !include smartDEN_IP_Maxi.SNMP/sensors.yaml
switch: !include smartDEN_IP_Maxi.SNMP/switches.yaml
input_number: !include smartDEN_IP_Maxi.SNMP/input_numbers.yaml
rest_command: !include smartDEN_IP_Maxi.SNMP/rest_commands.yaml
automation: !include smartDEN_IP_Maxi.SNMP/automations.yaml

There isn’t a binary snmp sensor so you will have to create template binary sensors from your snmp sensors:

binary_sensor:
  - platform: template
    sensors:
      digital_1:
        friendly_name: "Digital Input 1"
        value_template: "{{ is_state('sensor.digital_input_1', '1') }}"
      digital_2:
        friendly_name: "Digital Input 2"
        value_template: "{{ is_state('sensor.digital_input_2', '1') }}"

Thank you very much Tom,
Works like a charme :slight_smile: :ok_hand:

I came frome Domoticz recently .
Now i am happy with HA.

Best regards