Fun with Mycroft and Home Assistant!

For my own guilty pleasure, Mycroft gives me positive feedback when I remember to charge my phone…

alias: MycroftThanksYou
description: ''
trigger:
  - platform: state
    entity_id: sensor.pixel6_battery_state
    to: charging
    from: discharging
condition:
  - condition: zone
    entity_id: device_tracker.pixel6
    zone: zone.home
action:
  - service: notify.picroft
    data:
      message: You are so responsible, (yournamehere).
mode: single

1 Like

And of course, you don’t want to leave your phone continually on the charger. My good buddy Mycroft is there to remind me that I can begin discharging the battery again.

alias: PhoneIsCharged
description: ''
trigger:
  - type: battery_level
    platform: device
    device_id: 52ea4cf51e484a766db41226624686c6
    entity_id: sensor.pixel6_battery_level
    domain: sensor
    above: 95
condition:
  - condition: zone
    entity_id: device_tracker.pixel6
    zone: zone.home
  - condition: state
    entity_id: sensor.pixel6_battery_state
    state: charging
  - condition: device
    type: is_off
    device_id: 256b1be04f12d1acdbe125b15e938268
    entity_id: switch.bedcharge_socket_1
    domain: switch
action:
  - service: notify.picroft
    data:
      message: (yournamehere), your phone is charged.
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - condition: state
    entity_id: sensor.pixel6_battery_state
    state: charging
  - service: notify.picroft
    data:
      message: Please remove your phone from the charger.
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - condition: state
    entity_id: sensor.pixel6_battery_state
    state: charging
  - service: notify.picroft
    data:
      message: Are you ignoring me? Your phone is fully charged.
mode: single

2 Likes

I’ve created a monster…My lovely lady cannot fathom cooking the rice anymore without this automation.

alias: Rice Cooking
description: ''
trigger:
  - platform: device
    type: turned_on
    device_id: d824ea748dfbfd1fdd88ae49fc092faa
    entity_id: switch.therice_socket_1
    domain: switch
    for:
      hours: 0
      minutes: 20
      seconds: 0
condition: []
action:
  - type: turn_off
    device_id: d824ea748dfbfd1fdd88ae49fc092faa
    entity_id: switch.therice_socket_1
    domain: switch
  - service: notify.picroft
    data:
      message: The rice has finished cooking.
mode: single

2 Likes

And after a hard day at work, at least someone is happy to see me. Usually my dog is, and I’m pretty sure my lovely lady is too… But just in case they’re both mad at me for some reason I can trust that Mycroft won’t be.

alias: WelcomeBackHome
description: ''
trigger:
  - platform: event
    event_data:
      domain: scene
      service: turn_on
      service_data:
        entity_id: scene.back_home
    event_type: call_service
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: notify.picroft
    data:
      message: Welcome back. I hope you had a good day.
mode: single

2 Likes

Last, but not least. With work out of my thoughts, while at home, I’m reminded twice a week to charge my tool batteries. I hate being in a repair situation and something doesn’t work because I forgot to charge the dang battery! I’m sure there will be more automations along the way, but this is most of what I have so far.

alias: WorkTruckBatteries
description: ''
trigger:
  - platform: time
    at: input_datetime.worktruckbatteries
condition:
  - condition: time
    before: '00:00:00'
    after: '17:00:00'
    weekday:
      - wed
      - sun
action:
  - service: notify.picroft
    data:
      message: 'You need to charge your work truck batteries '
  - service: notify.mobile_app_pixel6
    data:
      title: BATTERY REMINDER
      message: >-
        You need to go back outside to your truck, gather all the batteries, and
        charge them. 
mode: single

2 Likes

So COOL!!!

Keep those snippets coming. :muscle:

2 Likes

lol they are great - that Mycroft can be a demanding master too!

1 Like

If I have a mark 2 will home automation detect the camera on it?

Hi, big fan of HomeAssistant.

I can’t get mine connected however… I receive this error:
“MycroftAPI’ object has no attribute '_ws”

They are on the same network/VLAN/Subnet.

Any ideas?

1 Like

That might be a question for the home assistant people. I’m not sure exactly how the skill integrates with mycroft. I didn’t make the skill but if the camera could somehow be released as an rtsp stream on your network then it could be dumped into home assistant.

1 Like

Did you build your own Mycroft or are you using a Mark 2? I’m using the Picroft enclosure. I wonder if there’s something different with the Mark 2.

The setup is pretty simple. You just need to point the Mycroft host in your configuration.yaml and then also in the notify section for Mycroft to receive notifications. You also need to make sure and go to the home.mycroft.ai web page and plug in your home assistant url/ or IP. That’s where you customize all your skills.

Sorry if you already know and did this. Also make sure you’re not using some sort of DNS forwarding and forgot about it. I’m using a DuckDNS URL for home assistant and I also have my router resolving that internally on the home network. So nothing at home points to the static IP address of Home assistant but the actual domain name.

Mark 2. My config looks good, and token has been properly generated.

The funny part is… It worked on Classic WITHOUT a token. Does not work on Dinkum with the token

configuration.yaml:

mycroft:
host: 192.168.93.104

notify:

  • platform: mycroft
    name: Mycroft

So assuming it’s a bug on Dinkum at this point…

The Mark ii’s home assistant skill does not use the old integration.

The new skill operates 100% on the mycroft and talks to the HA server over the API, no configuration changes in HA are necessary.

The snippets nerlins has posted will not work on the Mark ii. Currently there is no way to send notifications from HA to the new HA mycroft skill on the Mark ii, I’ve opened a feature request here: Sending notifications from HA to the mycroft · Issue #115 · MycroftAI/skill-homeassistant · GitHub

more info here: Mycroft Mark II with Home Assistant - #2 by goldyfruit

Well that certainly explains why Classic works and Dinkum does not.

Another disappointment… Appreciate your reply though!

We should come up with a clever acronym for “Works in Classic not in Dinkum”

WICNID maybe?

2 Likes

dont forget the difference between classic core dev branch (what everyone gets) and classic core mk2 branch (sandbox images only), theres now 3 different official mycroft “core” editions with different degrees of compatibility between each other.

Not sure an acronym is enough

2 Likes

Pardon my french, but why the hell would I want to buy Mark 2 if it can’t do exactly what my custom installation does? Why was this crippled?

Don’t swear at me please, I just wandered in here when my Mark ii box arrived today.

For some reason I thought you were a developer talking about opening a feature request. I misread your post. But really it wasn’t directed at you but developers. This is a major step backwards.

Sure is! My Mark II showed up last week and it’s basically a $300 digital clock.

1 Like