Compare commits

..

5 Commits

Author SHA1 Message Date
Pawel
84baf6486a Merge pull request #30 from SQ9MDD/main
Update serial_no.yaml
2025-07-18 09:03:28 +02:00
Rysiek Labus (SQ9MDD)
0d1676a53f Update serial_no.yaml 2025-07-17 20:56:31 +02:00
pszafer
c1e24bd26f fix sdm path 2025-06-24 20:47:08 +02:00
pszafer
85b38bf32c fix to main 2025-06-24 20:36:33 +02:00
pszafer
509a1fe7c2 dimmer gen2 with can and v0_9 with can 2025-06-18 11:25:39 +02:00
3 changed files with 92 additions and 21 deletions

View File

@@ -1,15 +1,27 @@
substitutions: substitutions:
name: boneio-dr-gen2-8ch-dev04 name: boneio-dr-gen2-8ch-dev04
friendly_name: 'BoneIO Dimmer dev0.4' friendly_name: 'BoneIO Dimmer dev0.4'
serial_prefix: 'dim' #Don't change it. serial_prefix: 'dim2' #Don't change it.
firmware_manifest: 'https://boneio.eu/esp/boneio-dr-gen2-8ch-dev04.json' firmware_manifest: 'https://boneio.eu/esp/boneio-dr-gen2-8ch-dev04.json'
esphome: esphome:
name: '${name}' name: '${name}'
friendly_name: '${friendly_name}' friendly_name: '${friendly_name}'
name_add_mac_suffix: false name_add_mac_suffix: true
project: project:
name: boneio.dimmer-led-gen2 name: boneio.dimmer-led-gen2
version: 'dev0.4' version: 'dev0.4'
on_boot:
priority: -100
then:
- delay: 5s
- if:
condition:
lambda: 'return id(serial_no) != nullptr;'
then:
- component.update: serial_no
- logger.log: "Serial No updated on boot"
else:
- logger.log: "Serial No component not found"
esp32: esp32:
board: esp32-s3-devkitc-1 board: esp32-s3-devkitc-1
@@ -17,13 +29,13 @@ esp32:
ethernet: ethernet:
id: eth id: eth
type: W5500 type: W5500
clk_pin: GPIO12 clk_pin: GPIO13
mosi_pin: GPIO39 mosi_pin: GPIO39
miso_pin: GPIO38 miso_pin: GPIO38
cs_pin: GPIO13 cs_pin: GPIO12
interrupt_pin: GPIO2 interrupt_pin: GPIO2
reset_pin: GPIO1 reset_pin: GPIO1
# Enable fallback hotspot (captive portal) in case wifi connection fails clock_speed: 25MHz
external_components: external_components:
- source: github://boneIO-eu/esphome-LM75@main #Original source and thank you note for BTomala https://github.com/boneIO-eu/esphome-lm75 - source: github://boneIO-eu/esphome-LM75@main #Original source and thank you note for BTomala https://github.com/boneIO-eu/esphome-lm75
@@ -85,17 +97,18 @@ output:
inverted: false inverted: false
id: chr04 id: chr04
##CAN gpio1 - tx, gpio2 rx
##CAN gpio48 - tx, gpio47 rx, gpio35 stb
modbus: modbus:
send_wait_time: 200ms send_wait_time: 80ms
uart_id: boneio_uart uart_id: boneio_uart
id: boneio_modbus id: boneio_modbus
packages: packages:
internals_packages: internals_packages:
url: https://github.com/boneIO-eu/esphome url: https://github.com/boneIO-eu/esphome
ref: v1.6.0 ref: v1.6.1
files: [ files: [
'devices/serial_no.yaml', 'devices/serial_no.yaml',
# 'devices/dimmer_i2c.yaml', # 'devices/dimmer_i2c.yaml',
@@ -105,32 +118,37 @@ packages:
ref: main ref: main
refresh: 1min refresh: 1min
files: files:
- path: sdm630/package.yaml - path: sdm630.yaml
dashboard_import: dashboard_import:
package_import_url: github://boneIO-eu/esphome/boneio-dimmer_g2_8ch-dev0_4.yaml@latest package_import_url: github://boneIO-eu/esphome/boneio-dimmer_g2_8ch-dev0_4.yaml@main
import_full_config: true import_full_config: true
pcf8574: pcf8574:
- id: 'pcf_inputs' - id: 'pcf_inputs'
address: 0x38 address: 0x38
# http_request:
# timeout: 7s
# verify_ssl: false
logger: logger:
hardware_uart: UART0 hardware_uart: UART0
api: api:
reboot_timeout: 0s reboot_timeout: 0s
ota: ota:
- platform: esphome - platform: esphome
- platform: http_request # - platform: http_request
update: # update:
- id: update_std # - id: update_std
platform: http_request # platform: http_request
name: Firmware Update # name: boneIO FW Update
source: ${firmware_manifest} # update_interval: 3 minutes
# source: ${firmware_manifest}
web_server: web_server:
port: 80 port: 80
version: 3
local: true local: true
@@ -218,8 +236,23 @@ switch:
mode: mode:
output: true output: true
inverted: false inverted: false
- platform: gpio
id: can_bus_switch
name: 'CAN Bus Switch'
pin:
number: GPIO35
mode:
output: true
inverted: false
- platform: gpio
name: "CAN RX"
pin: GPIO47
- platform: gpio
name: "CAN TX"
pin: GPIO48
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
name: 'IN_01' name: 'IN_01'
id: in_01 id: in_01
@@ -299,4 +332,40 @@ binary_sensor:
mode: mode:
input: true input: true
inverted: true inverted: true
- platform: template
name: CAN Bus Button
id: can_bus_button
# canbus:
# - platform: esp32_can
# tx_pin: GPIO48
# rx_pin: GPIO47
# can_id: 4
# bit_rate: 50kbps
# on_frame:
# - can_id: 5
# then:
# - lambda: |-
# if(x.size() > 0) {
# switch(x[0]) {
# case 0x12: // button release
# id(can_bus_button).publish_state(false);
# break;
# case 0x11: // button press
# id(can_bus_button).publish_state(true);
# break;
# }
# }
# button:
# - platform: template
# name: 'CAN Sensor ON'
# on_press:
# - logger.log: Button Pressed
# - canbus.send: [0x11, 0x22, 0x33]
# - platform: template
# name: 'CAN Sensor OFF'
# on_press:
# - logger.log: Button Pressed
# - canbus.send: [0x12, 0x22, 0x33]

View File

@@ -61,11 +61,13 @@ packages:
logger: logger:
api: api:
reboot_timeout: 0s reboot_timeout: 0s
# http_request:
# verify_ssl: false
ota: ota:
- platform: esphome - platform: esphome
- platform: http_request # - platform: http_request
name: Firmware Update # name: Firmware Update
source: https://boneio.eu/esp/ # source: https://boneio.eu/esp/
web_server: web_server:
port: 80 port: 80

View File

@@ -4,7 +4,7 @@ text_sensor:
id: serial_no id: serial_no
lambda: |- lambda: |-
std::string mac = get_mac_address(); std::string mac = get_mac_address();
return to_string("${serial_prefix}") + mac.erase(0, mac.length()/2); return std::string("${serial_prefix}") + mac.substr(mac.length()/2);
icon: mdi:expansion-card-variant icon: mdi:expansion-card-variant
entity_category: diagnostic entity_category: diagnostic
update_interval: 60min update_interval: 60min