GithubHelp home page GithubHelp logo

Comments (30)

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024 1

Thank you so much for your great work, I really appreciate it!

from domoticz-aurora-theme.

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024

As the manual states, not all items currently have dataviz. Feel free to add this though. Look at the dataviz.js code. At the top you will see all the commands. Try adding one for yours, and then share the code with us?

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

I will! i saw that after i filed this. :)

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

I can't find a specific item for rain sensor or my temp/hum-combined sensor in html. wind is there but i can't get it to visualize. tried "ws", "any" as data source but nothing.

temp/hum combined sensor
image

Rain sensor(also from combined)
image

Temp/hum sensor that works with dataviz (with item temp)
image

or am i doing it completely wrong :)

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

listed stuff through json api instead. i guess the item-types should be from there but with small caps?

from domoticz-aurora-theme.

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024

// listed stuff through json api instead. i guess the item-types should be from there but with small caps?

Spot on! I did it like this:

  1. Open the normal dataviz page for your sensor
  2. Look in the console to find the three JSON requests it usually makes (day, month year).
  3. Check out the day json response by opening that url in a new window. That will show you what data the normal dataviz uses. That will give a big hint as to which code it needs here too.

from domoticz-aurora-theme.

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024

I've added some code that will give items with the icecube icon an 'ice' class, and items with a rain icon a 'rain' class. That may help you target your sensors.

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

sweet i'll have another try :)

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

2 different temp sensors one with only temp/hum and one frome a weather station with multiple sensors. but temp/hum is one of them. if looking at json request for graph is the same but i can se in html output for the different sensors there is differences on the bstatus row

Working temp sensor (gives bg viz)
/json.htm?type=graph&sensor=temp&idx=98&range=day
html:
image

weather station temp sensor (no bg viz)
/json.htm?type=graph&sensor=temp&idx=108&range=day
html:
image

hasdataviz is added by aurora. but the temp item. is that what aurora uses to find what to put temp graphs on or is that added from aurora too?

from domoticz-aurora-theme.

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024

The aurora theme looks at the image that the element had, and uses that to give the element a CSS class. So a temperature icon -> "temp" class. Icecube icon -> "ice" class.

The URL you posted tells us something important:
/json.htm?type=graph&sensor=temp&idx=98&range=day

Namely, that dDomoticz can show the dataviz in the same what that it does for temperature sensors.

So that has to go here:
generateDataviz($(this),"temp", "ba");

Now for the last part of that call. Open this link in a new browser window:
[your domoticz base url here]/json.htm?type=graph&sensor=temp&idx=98&range=day

So for example:
192.168.1.10:8080/json.htm?type=graph&sensor=temp&idx=98&range=day

There you will see the raw data that Domoticz usually sends to its dataviz function. There you will be able to find the last piece of the puzzle.

You will see something like "te" or "v" or "any" as the name for the data that is not the timestamp data. take that as the second part of the call.

So put that here:
generateDataviz($(this),"temp", "here");

So now that I think about it, all that CSS classname stuff is not relevant :-D

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

Ah that last piece was what i got stuck on. Since there is allready a temp post i tought that should be enough and started looking for other clues. I'll try tonight.

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

Non viz sensor (idx108)
image

viz sensor(98)
image

both uses "te" wich is already in the js viz file. hmmm..?

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

Ah! Think i fond whats wrong! Negtive values don't give you a viz!

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

have another temp/hum sensor outside(same model that gives viz) but this one is in negative temp range and viola no viz!
Creating new issue for negative values #24

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

Rain sensor

image

This should work then

            $(this).find('.item.rain:not(.bandmember):not(:has(.dataviz))').each(function () {
                $(this).addClass('hasdataviz');
                generateDataviz($(this),"rain", "mm");
            });	

after cache cleanup a viz graph!
image

awesome!

Just the issue with negative values to fix.
i'll add as many sensors as i can

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

having some trouble with a visibility sensor:
in html
image

tested this:

                $(this).find('.item.visibility:not(.bandmember):not(:has(.dataviz))').each(function () {
                    $(this).addClass('hasdataviz');
                    generateDataviz($(this),"counter", "v");
                });

json
image

not sure if item.visibility is right? you say it looks at icon. should i look somwhere else?

json more info
image

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

added wind and rain atleast in pull request.

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

more mockups values and imgtype taken from dummy sensors. i get no graph for dummy sensors so not sure this works.

                $(this).find('.item.air:not(.bandmember):not(:has(.dataviz))').each(function () {
                    $(this).addClass('hasdataviz');
                    generateDataviz($(this),"counter", "co2");
                }); 
                $(this).find('.item.speaker:not(.bandmember):not(:has(.dataviz))').each(function () {
                    $(this).addClass('hasdataviz');
                    generateDataviz($(this),"counter", "v");
                });
                $(this).find('.item.moisture:not(.bandmember):not(:has(.dataviz))').each(function () {
                    $(this).addClass('hasdataviz');
                    generateDataviz($(this),"counter", "v");
                });
		$(this).find('.item.leaf:not(.bandmember):not(:has(.dataviz))').each(function () {
                    $(this).addClass('hasdataviz');
                    generateDataviz($(this),"temp", "hu");
                });

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

Could the ice icon mess with neg values viz?

from domoticz-aurora-theme.

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024

I've added air, speaker, moisture and leaf classes. (See line 1358 in custom.js)

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

thanks. added some more in custom.js. gas and leaf moisture i can't get to work. leaf wetness don't seem to have a graph. gas i have no idea. should work. uncommentet those
edit. leaf wetness have graph but not reachable by the leaf icon. maybe no correlation

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

visibility, speaker, moist don't show month on viz. something missing for those

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

ah different data values for month it seems. how do i solve this. "any" maybe?
image

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

no "any" does not work it takes every value. min,max,avg so you get a sawtooth pattern. hm. some other solution is needed

Kind of stuck on this. creating new issue for month display on averaging sensors Issue: #27

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

I think this should be the last sensors. so close after pull and verify

from domoticz-aurora-theme.

flatsiedatsie avatar flatsiedatsie commented on July 4, 2024

I see you added a call to make dataviz on items with a "Waterflow" class. But that class is not yet added to the html.

If two sensortypes types use the same image, but require different dataviz calls (percent vs counter, for example), then the theme cannot currently handle that. Adding the classes based on the image is a bit of a hack after all.

So I suspect in these cases we have to make a choice which of the two sensor types is the one that gets the dataviz.

Waterflow vs ....?

(Also, I try to keep classes all lowercase).

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

Waterflow i found in the item class already for that item. used that to separate items seem to work. get graph on both items. i commented that ugly sollution at least :D

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

water flow
image
image

soil moisture
image
image

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

could use SoilMoisture instead of generated moisture to really separate them

from domoticz-aurora-theme.

xztraz avatar xztraz commented on July 4, 2024

This seem to work so i think we can close this? month bug in other issue

from domoticz-aurora-theme.

Related Issues (20)

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.