In group if state ==

I have a group for steamfriend and one for steamonline

Gaming:
  name: Gaming
  icon: mdi:gamepad
  view: yes
  entities:
    - group.steamfriends
    - group.steamonline

steamonline:

steamfriends:
    - sensor.steam_76561197967074071
    - sensor.steam_76561198098414453
    - sensor.steam_76561197971363749
    - sensor.steam_76561198084188335
    - sensor.steam_76561198082613244
    - sensor.steam_76561197989638055
    - sensor.steam_76561198065113466
    - sensor.steam_76561197994123556

I like to have online friends in the online group:
customize.yml

 group.steamonline:
   templates:
     entity_id: return Object.keys(entities).filter(key => entities[steam].state === 'online')

But im not sure which value to use here:

States in dev tool:

[sensor.steam_76561197967074071](http://10.3.1.2:8123/dev-state#) online
[sensor.steam_76561197988778714](http://10.3.1.2:8123/dev-state#) away
[sensor.steam_76561198339743479](http://10.3.1.2:8123/dev-state#) offline

I cant get it to work somehow, does anyone has some tricks?