Switch? with rest command

Hi,

How can i create a (fan) switch or slide bar in HA and send ‘rest commands’ to the ITHO unit? My end goal is to have the (fan) switch or slide bar also in Homekit.

I have connected my ITHO demand flow to HA. Every room has is own valve to the mechanical ventilation. I am able to put per room the valve in ‘high’, ‘low’ or ‘auto modus’, i can send commands via a rest command:

if the valve needs to extract a lot of air, I send the following command:

http://192.168.1.117/api.html?vremotecmd=high&vremoteindex=0

if the valve needs to extract les of air (so less noise), I send the following command:

http://192.168.1.117/api.html?vremotecmd=low&vremoteindex=0

if the valve needs to extract air based on the amound of Co2 in the room, I send the following command:
http://192.168.1.117/api.html?vremotecmd=auto&vremoteindex=0

How can i create a (fan) switch or slide bar in HA and send ‘rest commands’ to the ITHO unit? My end goal is to have the (fan) switch or slide bar also in Homekit.

Thanks for your help!!

How is that a switch? Doesn’t it need “off” or is “auto” kinda like off?

Something like this (assuming that the IP, Mode and Remote could be variables) – put this in a rest_command.yaml include or use rest_command: to prefix it in configuration.yaml:

itho_set:
  url: http://{{ ipAddress }}:api.html?vremotecmd={{mode}}&vremoteindex={{remoteidx}}

Then use a button to call a service, it would include like:

    tap_action:
      action: call-service
      service: rest_command.itho_set
      service_data:
        ipAddress: '192.168.1.117'
        mode: 'high'
        remoteidx: 0

hi Kbrown01! Yes, indeed, in terms of a switch auto is off. I don’t have a better name for it. Thanks for you suggestion, will implement it today! Really helpfull!