dm_mac.views.machine module
Views related to machine endpoints.
- async dm_mac.views.machine.locked_out(machine_name: str) Tuple[Response, int]
API method to set or un-set machine locked out state.
- async dm_mac.views.machine.oops(machine_name: str) Tuple[Response, int]
API method to set or un-set machine Oops state.
- async dm_mac.views.machine.update() Tuple[Response, int]
API method to update machine state.
Accepts POSTed JSON containing the following key/value pairs:
machine_name
(string) - name of the machine sending the updateoops
(boolean) - whether the oops button is pressedrfid_value
(string) - value of the RFID fob/card that is currentlypresent in the machine, or empty string if none present. Note that ESPHome strips leading zeroes from this, so inside this method it is left-padded with zeroes to a length of 10 characters.
uptime
(float) - uptime of the ESP32 (MCU).wifi_signal_db
(float) - WiFi signal strength in dBwifi_signal_percent
(float) - WiFi signal strength in percentinternal_temperature_c
(float) - internal temperature of the ESP32 in°C.
amps
(float; optional) - amperage value from the current clampammeter, if present, or 0.0 otherwise.
EXAMPLE Payloads for ESP without amperage sensor
RFID inserted (tag 0014916441)
{ 'machine_name': 'esp32test', 'oops': False, 'rfid_value': '14916441', 'uptime': 59.29299927, 'wifi_signal_db': -58, 'wifi_signal_percent': 84, 'internal_temperature_c': 53.88888931 }
RFID removed
{ 'machine_name': 'esp32test', 'oops': False, 'rfid_value': '', 'uptime': 119.2929993, 'wifi_signal_db': -54, 'wifi_signal_percent': 92, 'internal_temperature_c': 53.88888931 }