Pool pump Timer please save me arrrrrrr

Pretty sure you can define template device as switch.

Post config for the sonoff

EDIT
I was thinking of “device_class” but I think it only apply to sensor types.

Use template switch integration and make a proper switch

Thanks, I am trying all of the feedback received now.
@exxamalte, I am starting by implementing your cleaner version , thanks

I do need to figure out how to change the light to a switch as per the use of the code.
With the MQTT integration for the SONOFF and them all detected as lights, there is no .yaml includes specifying the lights, its all done in the integration. Ill attempt again, specifiying it with a include switch.yaml

Thanks for the replies, ill provide feedback on my success/failure shortly

So I Managed to get the Sonoff to import as a switch now instead of a light. I reset the Sonoff to factory and imported it straight away as switch. I can only think previous settings on the Sonoff in the console made changes to the import status prior. not sure, but anyhow, this has not resolved the service pool_pump check.

I can confirm that the switch works as it turns the pump on/off, the older component left no logs, the newer cleaner version by @exxamalte does leave logs.

Logged error:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 134, in handle_call_service
connection.context(msg),
File “/usr/src/homeassistant/homeassistant/core.py”, line 1232, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File “/usr/src/homeassistant/homeassistant/core.py”, line 1255, in _execute_service
await handler.func(service_call)
File “/config/custom_components/pool_pump_service/init.py”, line 83, in check
if await manager.is_water_level_critical():
File “/config/custom_components/pool_pump_service/init.py”, line 239, in is_water_level_critical
return entity_id and self._hass.states.get(entity_id).state == STATE_ON
AttributeError: ‘NoneType’ object has no attribute ‘state’

EDIT: Seems im missing this binary sensor ? binary_sensor.pool_water_level_critical?
I have added the below

pool_pump:
  switch_entity_id: switch.pool_pump
  pool_pump_mode_entity_id: input_select.pool_pump
  swimming_season_entity_id: input_boolean.swimming_season
  run_pool_pump_hours_swimming_season_entity_id: input_number.run_pool_pump_hours_swimming_season
  run_pool_pump_hours_off_season_entity_id: input_number.run_pool_pump_hours_off_season
  water_level_critical_entity_id: binary_sensor.pool_water_level_critical

into the configuration.yaml

Do you actually have a water level sensor binary_sensor.pool_water_level_critical? If not it should be possible to just remove that line from your configuration.

I feel like a complete idiot… like I ran 100 miles and tripped at the finish line…
dont think i need to explain more, all working … much appreciated. Thank you

1 Like

No worries.
Please also note that this new custom component generates a non-standard entity pool_pump.schedule that displays the next (or current) time period the pump is going to run.

Ahh Brilliant, that helps with a bit of guessing whether it should be running or not. Ive put it straight into use! lovely!

The latest HA update breaks the pool Schedule. I found a fix from another thread regarding a Strava plugin. If anyone wants a fix. Edit the custom_components\pool_pump_service\manifest.json

add a comma at the last line after codeowners and add a new line for version
“version”: “0.1”

see full example below

{
  "domain": "pool_pump",
  "name": "Pool Pump Manager",
  "requirements": [],
  "dependencies": [],
  "codeowners": ["@exxamalte"],
  "version": "0.1" 
}
1 Like

Could someone please give me a hand with setting this up?

Thanks! :slight_smile: homeassistant n00b

Did someone made a blueprint for the pool pump timer??