• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pilight / pimatic configurations
#31
Against location-structure: I fully agree with Zatta, we are controlling devices so it should be logically the first layer.
A device has physically a protocol, a location, a proposed function and a state.
You limit pilight itself with logically setting location as first layer cause for example devices could change their location.
The same counts for locations, locations could change frequently too.

Thinking big of the whole project you are working on, everything should be based on references.
Reducing that thought on the config, it is likely to decide to have different sections like devices, locations, rules, gui(elements) and then simply link them together with a reference.

Staying with the big object solution will cut the opportunities for future development drastically in my eyes.
 
Reply
#32
I already told that dropping the location layer could be a good idea. I was already at the separate GUI config part.
 
Reply
#33
Then we are on the same train anyway ;-)
 
Reply
#34
(05-04-2014, 01:27 PM)curlymo Wrote: [..]
But i agree that making a gui specific configuration would work well:
Code:
"livingroom.weather" {
    "views": [ "mobile", "desktop"]
    "decimals": 2
}
[...]
My suggestion would be that we somehow can define what the exceptions should be for either the mobile, tablet, desktop and/or webgui frontends.

The sample does not make much sense for me. I also think gui-decimals per device does not really make sense. I would prefer to have the same decimal for all values displayed in the gui.

(05-04-2014, 01:27 PM)curlymo Wrote: But then again, what would be wrong with just:
Code:
{
    "livingroom": {
        "name": "Living Room",
        "alllights": {
            "name": "Alle Lampen",
            "protocol": [ "kaku_switch" ],
            "id": [{
                "id": 123456,
                "unit": 15
            }],
            "state": "off",
            "all": 1,
            "gui-views": [ "mobile", "desktop"],
            "gui-decimals": 2,
            "gui-visible": 1
        }
    }
}

How would you handle Buttons? Make an extra protocol (so treat it as "device")?
 
Reply
#35
Quote:The sample does not make much sense for me. I also think gui-decimals per device does not really make sense. I would prefer to have the same decimal for all values displayed in the gui.
Why not give the user control?

Quote:How would you handle Buttons? Make an extra protocol (so treat it as "device")?
There are no "buttons", just device types which are defined to tell the GUIs what element to create:
http://www.pilight.org/development/protocols/#devtypes
 
Reply
#36
I thought you would probably introduce buttons, when eventing is ready.
 
Reply
#37
For what purpose?
 
Reply
#38
It's a GUI feature, you can trigger events or anything else with a click on a button.
 
Reply
#39
and it's handy to test events. Or to go to sleep (and shut down everything at once)
 
Reply
#40
Just add a generic_switch and add an event to check that switch. eg:
Code:
IF (generic_switch.id == 999999) OR (.....) THEN
generic_* devices are dummy devices for each device type.

Or we can indeed just add a button device type: https://github.com/pilight/pilight/blob/....h#L30-L42
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] pilight service crashing on first webserver access after reboot VrahoK 20 663 12-21-2019, 09:46 AM
Last Post: curlymo
  pilight-control modify values coolinx 16 731 11-13-2019, 08:02 PM
Last Post: curlymo
  Bug: double free or corruption in pilight-send blackzombie 12 710 10-07-2019, 08:15 PM
Last Post: blackzombie
  [Fixed] High CPU usage when pilight usb nano disconnects DieterK 1 294 08-13-2019, 05:43 PM
Last Post: curlymo
  pilight Nano USB interface curlymo 228 105,633 07-10-2019, 06:14 PM
Last Post: curlymo
  problems compiling pilight on Odroid C2 WitchDoctor 101 13,479 03-14-2019, 09:01 PM
Last Post: curlymo
  pilight 8 what chages for custom protocols? polo 11 3,581 02-15-2019, 06:22 PM
Last Post: polo
  pilight-debug shows nothing minhdomanh 3 742 10-18-2018, 07:01 AM
Last Post: felfert
  pilight-send and pilight-daemon DieterK 0 723 06-20-2018, 12:44 AM
Last Post: DieterK
  Lights not switched on or off by rules in pilight 8.1.0 rorie 22 3,225 06-12-2018, 03:56 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)