Setting up special mode for a room and using wallpanel for it

When we have sleepover guests, they sleep in our livingroom.
In the livingroom we hhave some automated lights, and a motionsensor, so that is not ideal when you are sleeping.
We also have a tablet running wallpanel, that gives out quite a lot of light, so I need to set the room to ‘sleepover guests’.

First of I have defined an input_boolan for the status:

  sleepover_guests:
    name: Marks if there are sleepover guests
    icon: mdi:sleep

All the automations for that room, then checks if it is set to off, here is an example for our ‘nightlight’ automation, we have others of course, but the idea is the same for them all.:

- id: '1558893031102'
  alias: Livingroom - Nightlight
  trigger:
  - entity_id: binary_sensor.livingroom_movement
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: input_boolean.sleepover_guests
    state: 'off'
  - below: '1'
    condition: numeric_state
    entity_id: sensor.livingroom_lux
  - condition: state
    entity_id: light.tapetlampe
    state: 'off'
  action:
  - data:
      brightness_pct: 10
      entity_id: light.tapetlampe
    service: light.turn_on
  - data:
      entity_id: input_boolean.nightlight_livingroom
    service: homeassistant.turn_on

Then at noon, the sleepover_guests is reset:

- id: '1565774404861'
  alias: Tablet - sleepover mode - timed reset
  trigger:
  - at: '12:00'
    platform: time
  condition:
  - condition: state
    entity_id: input_boolean.sleepover_guests
    state: 'on'
  action:
  - data:
      entity_id: input_boolean.sleepover_guests
    service: homeassistant.turn_off

The real magic is with the wallpanel app by thanksmister. It can be controlled with mqtt (the tablet has the topic wallpanel/livingroom), so it’s a breaze.
I’ve created two dashboards for this, the normal one, and the sleepoverguests one.

The normal one (fribert.dash), I have a lot more definitions of course, for all the other tiles, but I’ll just show the important lines:

##
## Main arguments, all optional
##
## Acer Iconia 1280x800

title: Hovedside
widget_dimensions: [123,128]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 10
global_parameters:
    use_comma: 0
    precision: 1
    use_hass_icon: 1
    namespace: default

...

overnightguests:
    widget_type: input_boolean
    title: Gæster i stuen
    entity:  input_boolean.sleepover_guests

layout:
    - clock (2x1), lian, kenneth, nathalie, adrian, frontdoor (4x3)
    - glasmontre, dvd_reoler, tapetlampe, barskab, treklover  , nathalieloft
    - spisebord, kokkenbord, vitrine, spejl, kontor, sovevaerelselys
    - kaffemaskine, fluefanger, trappe, gang, adrianloft, spacer, have, pool, vandsten,yrpicture
    - stueetage, 1stesal, spacer, spacer
    - kokkenthermostat, stuethermostat, livingroomtemp, adrianthermostat, nathaliethermostat ,entretemp ,bathtemp ,havetemp, frontdoorlock, overnightguests

Then I have the ‘sleepover guests’ panel (blank.dash):

##
## Main arguments, all optional
##
## Acer Iconia 1280x800

title: Hovedside
widget_dimensions: [123,128]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 10

global_parameters:
    use_comma: 0
    precision: 1
    use_hass_icon: 1
    namespace: default

overnightguests:
    widget_type: input_boolean
    title: Gæster i stuen
    entity:  input_boolean.sleepover_guests

layout:
    -
    -
    -
    -
    -
    - spacer, spacer, spacer, spacer, spacer, spacer, spacer, spacer, spacer, overnightguests

To support these two panels, I have to home assistant automations.

The first one sets the room to sleepover mode, it changes the brightness in the tablet, turns off the nightlight in the room (if it is activated, by resetting the boolean that marks that), then turns off all christmas lights in the livingroom, and changes the dashboard:

- id: '1560365252406'
  alias: Tablet - sleepover mode
  trigger:
  - entity_id: input_boolean.sleepover_guests
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      payload: '{''brightness'': 1}'
      qos: 1
      topic: wallpanel/livingroompanel/command
    service: mqtt.publish
  - data:
      payload: '{''url'': ''http://homeassistant.fribert.dk:5050/blank'' }'
      qos: 1
      topic: wallpanel/livingroompanel/command
    service: mqtt.publish
  - data:
      entity_id: light.tapetlampe
    service: light.turn_off
  - data:
      entity_id: input_boolean.nightlight_livingroom
    service: input_boolean.turn_off
  - data:
      entity_id: group.all_stue_julelys
    service: homeassistant.turn_off

Then there is the ‘opposite’, to make the room go ‘normal’ again:

- id: '1560366115523'
  alias: Tablet - normal mode
  trigger:
  - entity_id: input_boolean.sleepover_guests
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      payload: '{''brightness'': 100}'
      qos: 1
      topic: wallpanel/livingroompanel/command
    service: mqtt.publish
  - data:
      payload: '{''url'': ''http://homeassistant.fribert.dk:5050/fribert'' }'
      qos: 1
      topic: wallpanel/livingroompanel/command
    service: mqtt.publish

The panels looks like this, sorry for the bad quality pictures:
The normal panel (the sleepover guests button is at the bottom right)


Then the sleepover mode, button is in the same position.

I hope this is understandable, and helps somebody that has the same needs.

2 Likes