Status as On/Off not Home/Not Home

Is it possible to show the state (on/off) for computers/consoles/routers etc that are always home?
Not really useful to show Home/Not Home for these devices.

Did you try the “value_template” -

- platform: template
      value_template: "{% if is_state('switch.wol', 'on') %}on{% else %}off{% endif %}"
        service: switch.turn_on
        entity_id: switch.wol
        service: switch.turn_off
        entity_id: switch.pc
1 Like

I was just reading about it right now via this post

However unless I am missing something it will just always be home because it has detected that it is connected to my router. So just changing the text to be on/off wouldn’t be enough… I’m thinking that i need to see if it is actually on or off (ping maybe). I think that is the link that i am missing…

Yes, I’m using the ping component to check if a machine is up and running or not.

I don’t think you need that - at least I don’t…
So what I mean is, if you base it on your known devices, you can see which devices are home/not home. What that really means is not their physical location but whether or not they are connected to your router. And if they are not connected (so showing not home) then they are off. No need to add a ping to that…

So simple! Thats what i was missing. Thanks

DDK, I turned discovery off so i needed ping.

So… the states were changing but I was still unable to change the name of the states.
I have tried through ping and discovery but neither work so i have obviously still done something wrong.

This in my config file if someone could point out my mistake.

Found some errors and fixed them. I no longer get any errors with below config but still not changing the state name.

  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: -33.9152560
  longitude: 151.1156200
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 3
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here:
  time_zone: Australia/Sydney
    # Add an entry for each entity that you want to overwrite.
      friendly_name: Garys Android Tab 'S'
      icon: mdi:tablet-android
      friendly_name: Garys iPhone
      icon: mdi:cellphone-iphone
      friendly_name: Ryans iPhone
      icon: mdi:cellphone-iphone
      friendly_name: HTPC
      icon: mdi:movie-roll
      friendly_name: QNAP
      icon: mdi:harddisk
      friendly_name: xBox One
      icon: mdi:xbox
      friendly_name: Lounge Room Light 
      icon: mdi:lightbulb-on-outline
      friendly_name: PS4 
      icon: mdi:playstation

# Show links to resources in log and frontend
# introduction:

# Enables the frontend

# Enables configuration UI

  # Uncomment this to add a password (recommended!)
  api_password: !secret api_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url:

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
  # Optional, allows Home Assistant developers to focus on popular components.
  include_used_components: true

# Discover some devices automatically

# Allows you to issue voice commands from the frontend in enabled browsers

# Enables support for tracking state changes over time

# View all events in a logbook

# Track the sun

# Logger

# Yeelight - Lounge Room
    - platform: yeelight
            name: Lounge Room
            transition: 1000
            use_music_mode: True
            save_on_change: True
            # name: Front Door

# Netgear Router R7000 NightHawk
  - platform: netgear
    username: !secret netgear_un
    password: !secret netgear_password
    interval_seconds: 10
    consider_home: 0:03:00
    track_new_devices: yes
  - platform: ping
      HTPC: !secret htpc_ip
      Laptop: !secret laptop_ip

# Weather prediction and QNAP
  - platform: template
        value_template: '{% if is_state("device_tracker.ps4", "home") %}online{% else %}offline{% endif %}'
        value_template: '{% if is_state("device_tracker.xboxsystemos", "home") %}online{% else %}offline{% endif %}'
  - platform: yr
  - platform: moon
  - platform: qnap
    host: !secret qnap_ip
    username: !secret qnap_un
    password: !secret qnap_password
    timeout: 30
      - status
      - cpu_usage
      - memory_percent_used
      - volume_percentage_used
      - network_tx

# Text to speech
  - platform: google

group: !include groups.yaml
automation: !include automations.yaml
1 Like

Solved it. For anyone new and wondering the same thing setting up the template means that you need to call it a different way… replace

- device_tracker.xboxsystemos


- sensor.xbox_sensor

or whatever you have called the new sensor. It obviously was not updating for me as i was looking at the wrong component… duh…

Notice the known device device_tracker.kyloren in the code I sent you. So no it will not be allways home.