Git Product home page Git Product logo

esp8266-with-nextion's Introduction

esp8266-with-nextion

TODO: write proper readme.

This is the project: https://twitter.com/oroce/status/939961381331329029

UI

The design can be accessed in figma: https://www.figma.com/file/CwikCf6WnkNAFd8NSSdeDFGO/nextion-2.4

The assets for the design can be found in the assets directory.

HMI

The HMI for the Nextion display can be found the assets directory.

Starting

ESP code changes

You need create a config.json in the data directory with the following content:

{
  "mqtt_server": "<mqtt host>",
  "mqtt_port": <mqtt port>,
  "mqtt_user": "<mqtt username>",
  "mqtt_password": "<mqtt password>"
}

Sidenote: I'm using cloudmqtt, it's a great tool

Homeassistant changes

add a similar configuration to your the configuration.yaml:

automation:
  - alias: state sync for nextion
    hide_entity: True
    trigger:
      - platform: state
        entity_id: sensor.humidity_158d000153196d, sensor.temperature_158d000153196d, sensor.temperature_158d0001824749,sensor.humidity_158d0001824749,  sensor.temperature_158d0001823f4a,sensor.humidity_158d0001823f4a, sensor.frontdoor_status
    action:
      service: mqtt.publish
      data_template:
        topic: "nextion/reply-state"
        retain: True
        payload: >
          {
            "bedroom-humidity": {{ states.sensor.humidity_158d000153196d.state | string }},
            "bedroom-temperature": {{ states.sensor.temperature_158d000153196d.state | string }},
            "living-room-temperature": {{ states.sensor.temperature_158d0001824749.state | string }},
            "living-room-humidity": {{ states.sensor.humidity_158d0001824749.state | string }},
            "loggia-temperature": {{ states.sensor.temperature_158d0001823f4a.state | string }},
            "loggia-humidity": {{ states.sensor.humidity_158d0001823f4a.state | string }},
            "frontdoor": "{{ states.sensor.frontdoor_status.state | string }}"
           }

The above configuration will publish state to nextion/reply-state topic when

  • any of the sensors' state changed
  • thankfully to retain, mqtt will store the last message, so as the esp8266 boots up, it will automatically receive the latest state

The content of the message which gets published to nextion/reply-state is for me:

{
  "bedroom-humidity": 38.22,
  "bedroom-temperature": 23.13,
  "living-room-temperature": 23.02,
  "living-room-humidity": 39.35,
  "loggia-temperature": 5.81,
  "loggia-humidity": 81.86,
  "frontdoor": "closed"
}

TODOS

  • add license
  • proper docs
  • better json structure

esp8266-with-nextion's People

Contributors

oroce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esp8266-with-nextion's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.