How do you change Tplink Switch to a Door Class? so i can list it in Entity Card

i think i see my mistake in the code i kept the H

and didnt change the B

damn dislexia i had to re read it 10 times to notice… gonna fix it and see if it fixes

Change your binary sensor code to this:

######################
### Binary Sensors ###
######################
binary_sensor:
# Need to make a template to be able to change a Toggle Switch To On Of
# need to also change device class to something else to display other then ON OFF
# this is for when you dont have a binary sensor and you need to convert 
# a Tplink  Light Switch 
# Template is nothing visual  it just something you need to get entities
  - platform: template
    sensors:
    #Building Hot Water Tank
      b_hot_water_tank_on:
        friendly_name: "Building Hot Water Tank State"
        device_class: light
        value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'on') }}"
    # House Hot Water Tank
      h_hot_water_tank_on:
        friendly_name: "House Hot Water Tank State"
        device_class: light
        value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'on') }}"

You should then have two entities binary_sensor.h_hot_water_tank_on and binary_sensor.b_hot_water_tank_on.

Then use those as your entities in the entity cards.
I’m not sure who told you make the off entities but that wasn’t necessary

They are stable and official but development is fast, new features get added, old ones removed. Especially in the UI there’s a lot of stuff constantly changing/evolving so videos are outdated quickly. However the official documentation is pretty good and covers a lot and when they don help, there’s always this forum :slight_smile:

ok let me try… and i dunno how this doesnt give you guys headaches or frustration after a while. like you wanna bang your head off the wall lol.
i did add a 3rd entry an “unavaliable” one i seen some of my things had that as a state and that didnt help either lol but let me delete what i wrote and try that code above…

as for stable realeases… like even Windows 10 or any of them 1 release then just updates… but ya i guess if they are constantly changing the UI or or how its coded its not quite like windows where it doesnt change just added feature… but then again ive gotten frustrated with windows… i just wish the documentation was explained a bit better llike for a dummy to understand like the 1 thing said a slug sensor… what the heck is a slug sensor lol

but let me try that code to see if it fixs the reverse

so that code above didnt work its still reversed

now it kinda works if i change the Enity to the binary_sensor.h_hot_water_tank_on, one since the other is deleted… but the unvailiable one i had doesnt work… so how come i need the 1 entity… and why does it say On is Off and Off is on still ?

how do you guys not get lost sometimes… with my dislexia i have to re read what you guys wrote and double check… its frustrating when i cant understand it with a snap of a finger… but i slowly learning… and i appreciate the help… as i get frustrated for sure lol

this is what i had i tried to get 3 states… incase it goes offline… i was hoping ti display also if ON OFF or Offline (incase the Wifi switch is broken)

######################
### Binary Sensors ###
######################
binary_sensor:
# Need to make a template to be able to change a Toggle Switch To On Of
# need to also change device class to something else to display other then ON OFF
# this is for when you dont have a binary sensor and you need to convert 
# a Tplink  Light Switch 
# Template is nothing visual  it just something you need to get entities
  - platform: template
    sensors:
    ###############################
    ### Building Hot Water Tank ###
    ###############################
      b_hot_water_tank_on:
        friendly_name: "ON"
        #device_class: light
        value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'on') }}"
      b_hot_water_tank_off:
        friendly_name: "OFF"
        #device_class: light
        value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'off') }}"
      b_hot_water_tank_unavailable:
        friendly_name: "Offline (Broken)"
        #device_class: light
        value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'unavailable') }}"

    ############################
    ### House Hot Water Tank ###
    ############################
      h_hot_water_tank_on:
        friendly_name: "ON"
        #device_class: light
        value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'on') }}"
      h_hot_water_tank_off:
        friendly_name: "OFF"
        #device_class: light
        value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'off') }}"
      h_hot_water_tank_unavailable:
        friendly_name: "Offine(Broken)"
        #device_class: light
        value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'unavailable') }}"

The binary sensors work fine, but you seem to misunderstand how they work.

binary_sensor.b_hot_water_tank_on:
-> shows ‘on’ if the switch.b_hot_water_tank_switch is ‘on’ and ‘off’ if the switch.b_hot_water_tank_switch is ‘off’ or ‘unavailable’.

binary_sensor.b_hot_water_tank_off:
-> You don’t need that one, it’s the reverse of the above binary sensor.

binary_sensor.b_hot_water_tank_unavailble:
-> shows ‘on’ if the switch.b_hot_water_tank_switch is ‘unavailable’ and ‘off’ if the switch.b_hot_water_tank_switch is ‘on’ or ‘off’.

If you also want to show unavailable, all in the same place, you would need a template sensor, a binary sensor has only two states, ‘on’ or ‘off’.

sensor:
  - platform: template
    sensors:
      b_hot_water_tank_state:
        friendly_name: "Building Hot Water Tank Status"
        value_template: "{{ states('switch.b_hot_water_tank_switch') }}"
      h_hot_water_tank_state:
        friendly_name: "House Hot Water Tank Status"
        value_template: "{{ states('switch.h_hot_water_tank_switch') }}"

This will give you two sensors, sensor.b_hot_water_tank_state and sensor.h_hot_water_tank_state. These will exactly follow the switch, when the switch is ‘on’, it shows ‘on’, when the switch is ‘off’ it shows ‘off’ and when the switch is ‘unavailable’ it shows ‘unvavailable’.

oh ok let me try that
i appreciate the help… ya learning as i go… and then something else pops in my head an idea and then goes me different direction

id ask to change the color of the text when its on … but i think i asking for too much? i notice it will change the icons yellow… was hoping i could change font size like Bold or also change it yellow etc… but currently working on this ya i like the option unavaliuable… i only noticed it when i was flipinning through the develope states

but let me try that your current one…

so that one did no work i cant find no entity… but ill try a reboot and a cache clear… as i read u need to clear it all the time

No need to reboot, go to Configuration in the Sidebar → Server Controls → Press Reload Template Entities

Edit: and I found a type in the last line, there should only be one quote after switch.b_hot_water_tank_switch and the second switch should be the house one not the building one. I fixed my post.
See my fixed post.

didnt work even with the updated code and didnt see no reload template entities there is like group entities etc

but i did a restart server and tried restart HA still cant find a sensor.xxxx

unless its supposed to come up under something else

whatever that means

i just updated to 3.3 this morning and 3.4 is out i updating it… hopefully the code works in that version then not sure what the sensor. status isnt working

i appreciate the help… once this working maybe you guys can help me with the remote raspberry pi issue i having and this arduino issue i having seems no one can answer ):

Any error under Configuration -> Logs?
Can you post you4 complete condiguration.yaml file please? With sensitive date redacted.

crap i posted my yaml under the wrote topic ah crap lol
i fixed my issues but i posted it under the remote rpi gpio ugh gotta see if i can delete it ah crap… i had both 3 topics i working on and i posted it wrong one
i mentioned i found i had to sensors lol etc ugh

so i found i had 2
sensor: and i dont know why i have building bed room light i need to change that to house… but it seems to be working. i had couple spelling errors… the check configuration didnt show erors… but here is my log file and configuration… its messy as i playing around with differnt things
log file


The bridge HASS Bridge I0ZU has entity media_player.viziocastdisplay9742. For best performance, and to prevent unexpected unavailability, create and pair a separate HomeKit instance in accessory mode for this entity.
8:57:27 PM – HomeKit (WARNING)
Lost connection to 192.168.0.51:7345
8:57:27 PM – VIZIO SmartCast (WARNING)
remote_rpi_gpio: Error on device update!
8:57:23 PM – Binary sensor (ERROR)

021-03-12 20:57:10 WARNING (MainThread) [homeassistant.loader] You are using a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-03-12 20:57:23 ERROR (MainThread) [homeassistant.components.binary_sensor] remote_rpi_gpio: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 465, in async_device_update
await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/binary_sensor.py", line 100, in update
self._state = remote_rpi_gpio.read_input(self._button)
File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/__init__.py", line 61, in read_input
return button.is_pressed
AttributeError: 'NoneType' object has no attribute 'is_pressed'
2021-03-12 20:57:27 WARNING (MainThread) [homeassistant.components.vizio.media_player] Lost connection to 192.168.0.51:7345
2021-03-12 20:57:27 WARNING (MainThread) [homeassistant.components.homekit] The bridge HASS Bridge I0ZU has entity media_player.viziocastdisplay9742. For best performance, and to prevent unexpected unavailability, create and pair a separate HomeKit instance in accessory mode for this entity.

configuration yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
#sensor: !include sensor.yaml

hacs:
  token: deleted it

frontend:
  themes: !include_dir_merge_named themes

homeassistant:
  customize: !include customize.yaml

weather:
  - platform: environment_canada

#cover:
#  - platform: rpi_gpio
#    state_pull_mode: "UP"
#    invert_state: false
#    covers:
#      - relay_pin: 23
#        state_pin: 24
#        name: Sauna Valve

####################################
### TP Kasa Switchs, Outlets ETC ###
####################################
tplink:
  discovery: true
###############
### Switchs ###
###############
# switch:
#   - host: 192.168.0.100  # Building Hot Water Tank
#   - host: 192.168.0.101  # House Hot Water Tank
#   - host: 192.168.0.102  # Building Bedroom Light 2 Florences

#######################
### Mitch's Switchs ###
#######################
##    - host: 192.168.1.200  # Mitch's Hot Water Tank

########################
### Switchs GPIO ETC ###
########################
switch:
  - platform: rpi_gpio
    invert_logic: true
    ports:
      23: Water Valve # Sauna Water Pump Home Assistant Toggle Switch To Activate Pump with Arduino

  - platform: rpi_gpio
    #ports:
    #invert_logic: true
    ports:
      25: Generator Fuel
      12: Generator Choke
      16: Generator Start

  ### Reboot DSL Modem When It Crash's Using Relay ###
  - platform: remote_rpi_gpio
    host: 192.168.0.10
    ports:
      17: Reboot_DSL_Modem


#sensor:

###############
### Sensors ###
###############
#sensor:
# Sensor displays the actual State  of a switch or sensor.. not like 
# Binary sensor where it only disaplys On or OFF
 # - platform: template
 #   sensors:
    ###############################
    ### Building Hot Water Tank ###
    ###############################
  #    b_hot_water_tank_state:
   #     friendly_name: "Building Hot Water Tank Status"

#        value_template: "{{ states('switch.b_hot_water_tank_switch') }}"
    ############################
    ### House Hot Water Tank ###
    ############################
 #     h_hot_water_tank_off_state:
  #      friendly_name: "House Hot Water Tank Status"
   #     value_template: "{{ states('switch.b_hot_water_tank_switch') }}"
    #####################################
    ### Building Bedroom Light Switch ###
    #####################################
    #  b_bedroom_light_switch_state:
     #   friendly_name: "Building Bedroom Light Switch Status"
      #  value_template: "{{ states('switch.b_bedroom_light_switch') }}"
    ##############################
    ### Mutti's Hot Water Tank ###
    ##############################
#      m_hot_water_tank_off_state:
 #       friendly_name: "House Hot Water Tank Status"
  #      value_template: "{{ states('switch.m_hot_water_tank_switch') }}"
    


######################
### Binary Sensors ###
######################
binary_sensor:
# Need to make a template to be able to change a Toggle Switch To On Of
# need to also change device class to something else to display other then ON OFF
# this is for when you dont have a binary sensor and you need to convert 
# a Tplink  Light Switch 
# Template is nothing visual  it just something you need to get entities
# Binary sensors only display On or Off
  #- platform: template
   # sensors:
    #####################################
    ### Building Bedroom Light Switch ###
    #####################################
#      b_bedroom_light_switch_on:
 #       friendly_name: "ON"
        #device_class: light
  #      value_template: "{{ is_state('switch.b_bedroom_light_switch', 'on') }}"   
    ###############################
    ### Building Hot Water Tank ###
    ###############################
   #   b_hot_water_tank_on:
    #    friendly_name: "ON"
        #device_class: light
     #   value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'on') }}"
 #     b_hot_water_tank_off:
 #       friendly_name: "OFF"
 #       #device_class: light
 #       value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'off') }}"
 #     b_hot_water_tank_unavailable:
 #       friendly_name: "unavailable"
 #       #device_class: light
 #       value_template: "{{ is_state('switch.b_hot_water_tank_switch', 'unavailable') }}"

    ############################
    ### House Hot Water Tank ###
    ############################
      #h_hot_water_tank_on:
       # friendly_name: "ON"
        #device_class: light
      #  value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'on') }}"
#      h_hot_water_tank_off:
#        friendly_name: "OFF"
#        #device_class: light
#        value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'off') }}"
#      h_hot_water_tank_unavailable:
#        friendly_name: "unavailable"
#        #device_class: light
 #       value_template: "{{ is_state('switch.h_hot_water_tank_switch', 'unavailable') }}"
        
    ##############################
    ### Mutti's Hot Water Tank ###
    ##############################
#      m_hot_water_tank_on:
 #       friendly_name: "ON"
        #device_class: light
  #      value_template: "{{ is_state('switch.m_hot_water_tank_switch', 'on') }}"
      #m_hot_water_tank_off:
        #friendly_name: "OFF"
        #device_class: light
        #value_template: "{{ is_state('switch.m_hot_water_tank_switch', 'off') }}"
  #    m_hot_water_tank_unavailable:
  #      friendly_name: "unavailable"
  #      #device_class: light
  #      value_template: "{{ is_state('switch.m_hot_water_tank_switch', 'unavailable') }}"

#reboot DSL modem
  - platform: remote_rpi_gpio
    host: 192.168.0.10
    ports:
      17: Reboot_DSL_Modem

  - platform: rpi_gpio
    #    invert_logic: true
    ports:
      24: water_position # Sauna Water Pump Valve Sensor Postion  On/Off  (Open/Closed)
      5: Generator_Fuel_Status
      6: Generator_Choke_Status
      13: Generator_Start_Status

  #####################################################################
  ### Check Status Of Internet, Router, Servers also Mitchs Servers ###
  #####################################################################
  - platform: command_line
    name: Internet
    command: "ping -W 1 -c 1 8.8.8.8 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Mitchflix Server
    command: "ping -W 1 -c 1 192.168.1.9 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Mitchs Server
    command: "ping -W 1 -c 1 192.168.1.8 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Mitchs Router
    command: "ping -W 1 -c 1 192.168.1.1 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Main Server
    command: "ping -W 1 -c 1 192.168.0.3 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Backup Server
    command: "ping -W 1 -c 1 192.168.0.4 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Router
    command: "ping -W 1 -c 1 192.168.0.1 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: House AP 1
    command: "ping -W 1 -c 1 192.168.0.6 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Building AP 1
    command: "ping -W 1 -c 1 192.168.0.2 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Mitchs AP
    command: "ping -W 1 -c 1 192.168.1.2 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

  - platform: command_line
    name: Building Network Switch 1
    command: "ping -W 1 -c 1 192.168.0.5 > /dev/null 2>&1 && echo Up || echo Down"
    device_class: connectivity
    payload_on: "Up"
    payload_off: "Down"

###############
### Sensors ###
###############
sensor:
  ############################
  ### Time & Date Checking ###
  ############################

  # Minimal configuration of the standard time and date sensor
  - platform: time_date
    display_options:
      - "date_time_iso"
      - "time"
      - "date"
      
  - platform: template
    sensors:
      b_hot_water_tank_state:
        friendly_name: "Building Hot Water Tank Status"
        value_template: "{{ states('switch.b_hot_water_tank_switch') }}"
      h_hot_water_tank_state:
        friendly_name: "House Hot Water Tank Status"
        value_template: "{{ states('switch.h_hot_water_tank_switch') }}"
        
      m_hot_water_tank_state:
        friendly_name: "Mutti's Hot Water Tank Status"
        value_template: "{{ states('switch.m_hot_water_tank_switch') }}"
        
      b_bedroom_light_switch_state:
        friendly_name: "Bedroom Light Switch Status"
        value_template: "{{ states('switch.b_bedroom_light_switch') }}"
        
  ####################################
  ### BUILDING OUTSIDE TEMPERATURE ###
  ####################################
#  - platform: dht
#    scan_interval: .01
#    name: "Building Outside"
#    sensor: DHT11
#    pin: 18
    #    temperature_offset: -9
    #    humidity_offset: -3.2
#    monitored_conditions:
#      - temperature
#      - humidity

  ##############################
  ### MOMS HOUSE TEMPERATURE ###
  ##############################

#  - platform: dht
#    scan_interval: .01
#    name: "Moms House Outside"
#    sensor: DHT11
#    pin: 19
    #    temperature_offset: -9
    #    humidity_offset: -3.2
#    monitored_conditions:
#      - temperature
#      - humidity

  ################################
  ### MUTTIS HOUSE TEMPERATURE ###
  ################################

#  - platform: dht
#    scan_interval: .01
#    name: "Muttis House Outside"
#    sensor: DHT11
#    pin: 20
    #    temperature_offset: -9
    #    humidity_offset: -3.2
#    monitored_conditions:
#      - temperature
#      - humidity

That’s not correct syntax -> see here

So are the sensors working now or not?

In that case it might be being broken by the spaces in the binary sensor names further up.

You’ve said you’re working on three problems at the same time.
My advice would be to make one change at a time: then press the check config button and see what it says.
You can find that here:
Open your Home Assistant instance and show your server controls.

Please keep separate questions in separate topics, currently you are making a huge mess.

how i making a mess
but fine ill change it

ya that server control link does not do anything