MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Now I'm getting somewhere, HA turns screen on and off :-)



  • Ok, finally I found the right module. So the remote module in MagicMirror (MMM-Remote-Control), and then ‘rest_command:’ setup in HA.
    That way the motionsensor can turn the screen on and off in the mirror. For now I’ve made it simple with just defining four commands, two for on / off and two for dim / undim. And then just use those services in HA automations.
    Works perfectly.
    Now I need to turn some modules on and off depending on the time of day.

    The HA commands:

    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
    

    One of the automations (at night)

    - 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.undim_mm_screen
    

    Next step would be to modify rest_command so that I don’t have one for each action, but send a payload that is modified to the command that I want.


Log in to reply