I’m just starting with HA but already impressed with possibilities comparing to Hubitat I’m currently using. Will appreciate any hints or examples how to do what I want.
I’m implementing a solution for local non-profit makerspace. We have multiple tools like laser cutters, 3D printers, CNC router etc. External CRM handles userbase.
Problems that I’d need to solve:
- only certified users can use the tool (CRM knows who is certified)
- based on tool current wattage determine tool state (off, idling or doing work). Wattage thresholds are different for every tool.
- when user badges-in card reader makes a call to CRM, it verifies that user is certified and if OK turns on the tool saving userId
- when tools stops working - tool should calculate work time and send it back to CRM (webhook) across with userId
- when user badges-out the tools turns off
I’m connecting a tool through Z-wave smart plug so I could control power.
I’ve implemented this with 5 separate automations but will need to add more tools and it will be really complicated to support that many automations so I’m looking for something more elegant and extendable.
I’m trying to understand if I’m moving in correct direction.
- I’m adding new integration: Makerspace. It holds API endpoint and secret token
- Within integration I’m defining Tool device with Switch capabilities. Tool stores wattage thresholds for given tool
- Every Tool knows which existing Switch device it is connected to (how?)
- Every Tool defines webhook trigger. Badge-in webhook will save
userId
into device options, badge-out webhook clears it. - Device automations are watching switch’s status and update Tool’s state
- state change triggers call to CRM - get API URL and secret token from integration and make HTTP call