OpenPrintTag reader: pn5180 and openprinttag components, red flash on writes
CI / YAML lint (push) Failing after 17s
CI / ESPHome config validation (push) Successful in 55s

The reader config follows the split of pn5180 into the reader and the
openprinttag component; the notify LED flashes red while the
integration writes to a tag.
This commit is contained in:
randy committed 2026-10-03 18:18:42 +02:00
1 parent 5fdacb82df
commit 8eae480253
1 file changed
+35 -27
+35 -27
View File
@@ -46,7 +46,7 @@ packages:
external_components: external_components:
- source: github://randybb/esphome-components - source: github://randybb/esphome-components
components: [pn5180] components: [pn5180, openprinttag]
refresh: 1h refresh: 1h
# Called by the OpenPrintTag integration (openprinttag.update) to update the aux region # Called by the OpenPrintTag integration (openprinttag.update) to update the aux region
@@ -57,7 +57,18 @@ api:
uid: string uid: string
aux: string aux: string
then: then:
- lambda: id(pn5180_reader).write_aux(uid, aux); - if:
condition:
switch.is_on: led_enabled
then:
- light.turn_on:
id: notify_led
brightness: 100%
red: 100%
green: 0%
blue: 0%
flash_length: 500ms
- lambda: id(spool).write_aux(uid, aux);
spi: spi:
clk_pin: GPIO7 clk_pin: GPIO7
@@ -88,65 +99,62 @@ pn5180:
then: then:
- rtttl.play: "success:d=24,o=5,b=100:c,g,b" - rtttl.play: "success:d=24,o=5,b=100:c,g,b"
- homeassistant.tag_scanned: !lambda return x; - homeassistant.tag_scanned: !lambda return x;
# Raw tag record for the OpenPrintTag integration (randybb/ha-openprinttag)
on_openprinttag:
- homeassistant.event:
event: esphome.openprinttag
data:
uid: !lambda return uid;
payload: !lambda return payload;
on_tag_removed: on_tag_removed:
- homeassistant.event:
event: esphome.openprinttag
data:
uid: !lambda return x;
payload: ""
- if: - if:
condition: condition:
switch.is_on: buzzer_enabled switch.is_on: buzzer_enabled
then: then:
- rtttl.play: "removed:d=16,o=5,b=100:b" - rtttl.play: "removed:d=16,o=5,b=100:b"
openprinttag:
id: spool
# Raw tag record for the OpenPrintTag integration (randybb/ha-openprinttag), empty when removed
on_openprinttag:
- homeassistant.event:
event: esphome.openprinttag
data:
uid: !lambda return uid;
payload: !lambda return payload;
sensor: sensor:
- platform: pn5180 - platform: openprinttag
type: remaining_weight type: remaining_weight
name: Remaining weight name: Remaining weight
- platform: pn5180 - platform: openprinttag
type: consumed_weight type: consumed_weight
name: Consumed weight name: Consumed weight
- platform: pn5180 - platform: openprinttag
type: actual_weight type: actual_weight
name: Full weight name: Full weight
- platform: pn5180 - platform: openprinttag
type: min_print_temperature type: min_print_temperature
name: Min print temperature name: Min print temperature
- platform: pn5180 - platform: openprinttag
type: max_print_temperature type: max_print_temperature
name: Max print temperature name: Max print temperature
- platform: pn5180 - platform: openprinttag
type: max_bed_temperature type: max_bed_temperature
name: Max bed temperature name: Max bed temperature
- platform: pn5180 - platform: openprinttag
type: drying_temperature type: drying_temperature
name: Drying temperature name: Drying temperature
- platform: pn5180 - platform: openprinttag
type: drying_time type: drying_time
name: Drying time name: Drying time
text_sensor: text_sensor:
- platform: pn5180 - platform: pn5180
type: uid
name: Tag UID name: Tag UID
- platform: pn5180 - platform: openprinttag
type: material_type type: material_type
name: Material name: Material
- platform: pn5180 - platform: openprinttag
type: material_name type: material_name
name: Material name name: Material name
- platform: pn5180 - platform: openprinttag
type: brand_name type: brand_name
name: Brand name: Brand
- platform: pn5180 - platform: openprinttag
type: primary_color type: primary_color
name: Color name: Color
# Mirrored to the filament_color light, empty = no tag # Mirrored to the filament_color light, empty = no tag