Automation Frequently Fails to Trigger - Unknown Service

image

I monitor my Solar Inverter for energy export above threshold for n minutes. When it fulfills this condition I poll the Nicehash API to start my mining rig. It works sometimes. And it usually works when I manually trigger it in test. I have a separate automation that does the same in reverse (stops mining when I’m not generating excess solar).

I often get the unknown service error though. The error only seems to happen on the start automation, and not the stop automation for some reason too.

Nicehash miner.start_stop isn’t even part of my automation. So I’m not sure why it’s being called. Is it perhaps cached and left over from some initial config that’s no longer there?

Please post all the automations as text, not images. Also, this is a custom integration, so please post which one you’re using.

Here it is FWIW, but I have deleted and recreated it identical and no longer have the issue. Seems an old action might have been cached somewhere. 100% the error I was getting did not relate to any current config. Note this persisted through a reboot which is weird.

Note I’m using HACS with:

  • GoodWe SEMS API integration for Home Assistant
  • NiceHash custom integration by @RomRider
id: '1683764143565'
alias: start non critial usage (export threshold)
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.inverter_home
    for:
      hours: 0
      minutes: 1
      seconds: 0
    attribute: pmeter
    above: 1500
condition: []
action:
  - service: notify.mobile_app_marks_phone
    data:
      message: >-
        {{ ((states.sensor.inverter_home.attributes.pmeter | float / 1000 )) |
        round(2) }} kW export. Starting non critical usage.
      title: Solar export monitoring
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
        - switch.nh_mark_gigabyte_nvidia_geforce_rtx_3070_power
        - switch.nh_mark_intel_r_core_tm_i7_10700f_cpu_2_90ghz_power
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
mode: single

Interestingly I found an old/other Nicehash integration I no longer use from HACS, disabled…

I think the error relates to this. But again, the automation no longer referenced it. I’ll properly remove the unused/disabled integration. But again, it shouldn’t have been referenced.

image

Well, you’re not looking at the correct automation. The error message tells you the correct automation. It’ll have the name Export to Start Mining in your list.

This is all I have for the longest time…

So yeah. Something cached.

I may have renamed it at one point.

Edit: Yeah it is renamed. I recall clicking the “edit automation” link in the warning and getting to the correct automation and scratching my head not being able to find the action it referred to.

Anyway. It seems fixed now having deleted and recreated the automation. I’ll mark this as solved but certainly it’s unexpected behaviour happening under the hood somewhere. Removed parts of old automation configs shouldn’t be executing or throwing errors.