The integration is quite easy, and can do the most important stuff.
So the module to include in MagicMirror is ‘MMM-Remote-Control’. That opens a REST API for the MM.
With that it’s possible to create restfull commands.
In the config for the remote module you have to allow the HA to access it:
var config = {
address: "0.0.0.0",
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "HAIP"],
{
module: 'MMM-Remote-Control',
// uncomment the following line to show the URL of the remote control on the mirror
// position: 'bottom_left',
// you can hide this module afterwards from the remote control itself
config: {
// apiKey: ''
}
},
For me the first steps was to turn the screen on and off, and dim and undim it.
rest_command:
turn_off_mm_screen:
url: http://IP:8080/api/monitor/off
turn_on_mm_screen:
url: http://IP:8080/api/monitor/on
dim_mm_screen:
url: http://IP:8080/api/brightness/75
undim_mm_screen:
url: http://IP:8080/api/brightness/100
Now I can use these commands in automations:
This will turn on the light at 10%, and turn on the monitor in the magicmirror, and set it to only 75%
- id: '1557033756115'
alias: Turn on bathroom light at night
trigger:
- entity_id: binary_sensor.bathroom_movement
from: 'off'
platform: state
to: 'on'
condition:
- after: '23:00'
before: '7:59'
condition: time
- condition: state
entity_id: light.spejl
state: 'off'
action:
- data:
brightness_pct: 10
entity_id: light.spejl
service: light.turn_on
- data: {}
service: rest_command.turn_on_mm_screen
- data: {}
service: rest_command.dim_mm_screen
I think I’m going to try and optimize it a bit, so I can call the rest_commands with a payload that specifies what it should do, instead of having four different, but this works